XATransaction outside the application server

  • Thread starter =?ISO-8859-1?Q?Halld=F3r_=CDsak_Gylfason?=
  • Start date
?

=?ISO-8859-1?Q?Halld=F3r_=CDsak_Gylfason?=

Hello

I am writing a java application that gets messages of a JMS Message
Queue, and writes data from the messages to a database. This should be
done logically in a single transaction , so two phase
commit/XATransaction is needed. I am a bit confused on how to do it
after having looked at all the JTA stuff.

Note that the application does not run inside an application server
but I still need some transaction services.

Is it really enough to obtain UserTransaction (Client side) from JNDI
and use that to manage the transaction, or do I have to go more low
level and interact with the transaction manager, to enlist the
XAResources?

Anyway... Has somebody expirence with writing similar application?
What transaction API did you use?


Regards, Halldor
 
M

Mikkel Heisterberg

I must admit that I haven't tried it but configuring the transaction
manager for XA transactions and obtaining a UserTransaction from JNDI
should be enough - again I haven't tried.

I noticed that not many people are volunteering to answering on this
thread so there I might offer another place to ask or search. I don't
know which application server you are using but if you ask or search in
the forums on www.jboss.org you might find the answer - as long as you
post the answer back here also :)

I did a quick search there (go the forums and find the search box at the
bottom) for "UserTransaction" and "XA Transaction" and has multiple
pages of results. Some answers are JBoss specific but should be of help
anyways.

Anyways - just another place where you might find your answer...

lekkim
 
J

John Maline

The J2EE spec ver 1.3 section 4.2.3 says...

The J2EE Product Provider is not required to provide any transaction
management support for application clients.

I interpret that to mean that you can't count on using UserTransaction
in an external application. Nearby sections indicate that you can't
count on it for applets and you CAN count on transaction support in EJB
components.

So it's up to your vendor. They can chose to support external apps
using transactions, they can choose not to. BEA, for example, does
support external apps using transactions.

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,227
Latest member
Daniella65

Latest Threads

Top