XATransaction outside the application server

Discussion in 'Java' started by =?ISO-8859-1?Q?Halld=F3r_=CDsak_Gylfason?=, Jun 30, 2003.

  1. 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
    =?ISO-8859-1?Q?Halld=F3r_=CDsak_Gylfason?=, Jun 30, 2003
    #1
    1. Advertising

  2. 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

    Halldór Ísak Gylfason wrote:
    > 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
    Mikkel Heisterberg, Jul 1, 2003
    #2
    1. Advertising

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

    John Maline Guest

    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

    Mikkel Heisterberg wrote:
    > 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
    >
    > Halldór Ísak Gylfason wrote:
    >
    >> 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

    >
    >
    John Maline, Jul 2, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kristoffer Arfvidson
    Replies:
    7
    Views:
    585
    Shiv Kumar
    Jan 21, 2004
  2. =?Utf-8?B?T2xlZw==?=
    Replies:
    2
    Views:
    299
    =?Utf-8?B?T2xlZw==?=
    Jun 17, 2005
  3. John Holmes
    Replies:
    0
    Views:
    393
    John Holmes
    Feb 7, 2006
  4. may
    Replies:
    0
    Views:
    963
  5. Krzysztof Poc

    outside type, outside function

    Krzysztof Poc, Feb 3, 2012, in forum: C++
    Replies:
    1
    Views:
    273
    Victor Bazarov
    Feb 7, 2012
Loading...

Share This Page