I am using JBoss 4.0.1 and I've deployed a Datasource "Test" to connect to Postgres database.
This is what my java client which is running in JVM outside JBoss.
1. Lookup "UserTransaction" object in JBoss namespace. 2. Lookup "Test" datasource in JBoss namespace. (With JBoss 3.2.x it is not possible, it's possible only in JBoss 4.0.x by setting "<use-java-context>false</use-java-context>" in -ds.xml to deploy dataosure.) 3. Begin UserTransaction, Get connection object and do some database updates & either commit or rollback usertransaction. 4. But UserTransaction is not working. My database updates are always committed. I tested the same thing in EJB deployed on the JBoss and it works fine. The only problem is when I control the user transaction from outside JBoss JVM. I get no errors/exceptions but it doesnt work.
I've found that we can not control transaction from the client side on the UserTransaction object looked up from JBoss.(Though we can start from the client, we can commit or rollback only on server side).
Thanks for your reply. But the requirement says that I should use commit & rollback on UserTransaction object in the client. Is there anyother alternative to achive this using anyother Application Server other than JBoss?