I'm somewhat new to JBossTS and am having a few problems getting started. I wonder if someone could point me in the right direction :)
I'm trying to do something not dissimilar to whats being discussed in http://www.jboss.com/index.html?module=bb&op=viewtopic&t=117232 thread: my exact scenario is that I have a standalone Java App that connects to a single database via JDBC. Currently I am therefore able to use database-level transactions for all my transactionality. However, my next step in development is to allow multiple instances of the app to run, connected to the same database, in order to be able to load-balance across them. I'm therefore trying to setup a JTS that each instance can connect to in order to continue work within a shared transaction (i.e. instance 1 starts the transaction, instance 2 does some work, instance 3 commits the transaction).
However, I'm getting stuck very early on :) I've set up one server on which I've installed the full JTS package - I'm running it stand-alone, outside of an app server. I've installed the TransactionServer as a service and started it up. Looking at the logs, it seems that jacorb is up and running, with the transaction-server-service.log reporting that:
17:03:16 | [jacorb.poa] INFO : Using server ID (873949937) for transient POA
17:03:16 | [jacorb.orb.singleton] INFO : created ORBSingleton
17:03:16 | [jacorb.orb.giop] INFO : ClientConnectionManager: created new ClientGIOPConnection to 192.168.1.72:1616 (30d082)
17:03:16 | **checking 0
17:03:16 | **registering**
17:03:16 | Ready
17:03:16 | [jacorb.orb] INFO : ORB run
and the transaction-server.log reporting:
17:03:16,207 [Thread-0] INFO com.arjuna.ats.arjuna.logging.arjLoggerI18N - [com.arjuna.ats.arjuna.recovery.TransactionStatusManager_3] - TransactionStatusManager started on port 1617 with service com.arjuna.ats.arjuna.recovery.ActionStatusService
I'm thinking that I now want to write my app to call TransactionFactory.create() in order to get hold of a Control object - but its the step in the middle where I get lost: where do I lookup the TransactionFactory? I tried:
Hashtable env = new Hashtable ();
InitialContext ictx = new InitialContext(env);
NamingEnumeration ctxlist = ictx.list("");
Object o = ctxlist.next();
System.out.prinln("Found: " + o);
but this threw an exception, and the transaction-server-service.log showed a:
17:06:35 | [jacorb.orb.iiop] INFO : Opened new server-side TCP/IP transport to 192.168.1.31:4078
17:06:35 | [jacorb.giop.server.l] WARN : Received a request with a non-jacorb object key
17:06:35 | [jacorb.orb.iiop] INFO : Closed server-side transport to 192.168.1.31:4078
1. Do I need any special configuration in jboss-jts-properties.xml for this setup? I've setup the ObjectStore, set the jtaTMImplementation and jtaUTImplementation to jts - thats it.
2. How do I specify on which port the jacorb created by the Transaction Server listens on? It changes each time?
3. Should I be expecting to be able to look stuff up directly on that ORB?
Any pointers, help most appreciated!
Take a look at the examples that ship with the TS, they show how to write a client application for JTS.
Thanks for the speedy reply. I have taken a look at the examples, but I think in all these cases there is a Server that writes out an IOR to a file, then a client that reads in the IOR.
I'd like to expose the JTS via an ORB that all the clients can look up via JNDI - its the configuration of this that I'm stuck with.
So you either need to run the tx server in process with your JNDI server or have something read the tx server IOR from file and create a JNDI entry for it. Nothing JBossTS specific there, it's just basic JNDI management. Note that's it's an IOR that the client's will get via JNDI, not an ORB.
Note that's it's an IOR that the client's will get via JNDI, not an ORB.
Yes - sorry - the last sentence of my previous post was very badly phrased.
Ok - that makes sense - I'll give that a try. Thanks.
One last clarification: there's no way I can configure the TransactionService to publish onto the jacorb it starts itself?
What do you mean by 'publish onto'?