stand-alone JMS, other JDBC operations, and transactions ( ActiveMQ + JOTM + JDBC operations )

Discussion in 'Java' started by Jesus M. Salvo Jr., Feb 10, 2006.

  1. I need JDBC operations to be included with JMS transactions.

    The quick answer would be to use JTA ... but I am not using any application
    server nor any transaction manager.

    Furthermore, I only have one database ( Sybase ), and I would like to use
    Sybase via JConnect JDBC as the persistence for ActiveMQ, but also use the
    same Sybase database for JDBC operations ... and have these external JDBC
    operations and JMS sessions "combined into a single transaction". ( That is,
    when I consume a message from the queue, I would do other JDBC
    operations ... and that all of these should be treated as one
    transaction ).

    The closest thing that I can find is JOTM, an open source Java Transaction
    Manager JTA implementation.

    Has anyone used ActiveMQ  + JOTM ( no other appserver, no JNDI, etc. ) and
    have JMS transactions and JDBC transactions managed by JOTM ??

    What I am also concerned about is that, at the time that the article was
    published and when the feedbacks were posted, according to someone ( from a
    commercial competitor ) at that time, JOTM does not provide recovery:

    http://www.onjava.com/pub/a/onjava/2003/07/30/jotm_transactions.html?page=2


    Things must have changed since then for JOTM, and it appears it already
    provides recovery .. though since I am no expert with XA or JTA, I do not
    know if the recovery provided by JOTM is up to the required standard.
     
    Jesus M. Salvo Jr., Feb 10, 2006
    #1
    1. Advertising

  2. Jesus M. Salvo Jr.

    Ian Mills Guest

    Re: stand-alone JMS, other JDBC operations, and transactions ( ActiveMQ+ JOTM + JDBC operations )

    Jesus M. Salvo Jr. wrote:
    > I need JDBC operations to be included with JMS transactions.
    >
    > The quick answer would be to use JTA ... but I am not using any application
    > server nor any transaction manager.
    >
    > Furthermore, I only have one database ( Sybase ), and I would like to use
    > Sybase via JConnect JDBC as the persistence for ActiveMQ, but also use the
    > same Sybase database for JDBC operations ... and have these external JDBC
    > operations and JMS sessions "combined into a single transaction". ( That is,
    > when I consume a message from the queue, I would do other JDBC
    > operations ... and that all of these should be treated as one
    > transaction ).
    >
    > The closest thing that I can find is JOTM, an open source Java Transaction
    > Manager JTA implementation.
    >
    > Has anyone used ActiveMQ + JOTM ( no other appserver, no JNDI, etc. ) and
    > have JMS transactions and JDBC transactions managed by JOTM ??
    >
    > What I am also concerned about is that, at the time that the article was
    > published and when the feedbacks were posted, according to someone ( from a
    > commercial competitor ) at that time, JOTM does not provide recovery:
    >
    > http://www.onjava.com/pub/a/onjava/2003/07/30/jotm_transactions.html?page=2
    >
    >
    > Things must have changed since then for JOTM, and it appears it already
    > provides recovery .. though since I am no expert with XA or JTA, I do not
    > know if the recovery provided by JOTM is up to the required standard.
    >
    >

    The way I have done this in the past is to read the message off the
    queue, do the requied database operations, commit to the database and
    then consume the message from the queue. If anything fails during the
    database operations do a rollback and leave the message on the queue.
    Admitedly this does leave a slight possibility that the data could be
    commited to the database and the system crashing before the message is
    consumed. There may be other ways of doing this but this is a simple
    method of combining the two in to the same transaction.
     
    Ian Mills, Feb 11, 2006
    #2
    1. Advertising

  3. Jesus M. Salvo Jr.

    robert Guest

    Jesus M. Salvo Jr. escreveu:

    > I need JDBC operations to be included with JMS transactions.
    >
    > The quick answer would be to use JTA ... but I am not using any application
    > server nor any transaction manager.
    >


    I've never used JTOM, but I have used the transaction manager from the
    spring framework, with lots of success.

    http://www.springframework.org/docs/reference/transaction.html

    Spring also has a lot of support for activemq:

    http://activemq.org/Spring Support

    HTH,
    robert
    http://www.braziloutsource.com/
     
    robert, Feb 11, 2006
    #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. nicc777
    Replies:
    2
    Views:
    649
  2. Replies:
    0
    Views:
    1,215
  3. Replies:
    7
    Views:
    440
    Andrew Thompson
    Feb 23, 2007
  4. Michael Justin
    Replies:
    12
    Views:
    1,211
    Arne Vajhøj
    Nov 26, 2009
  5. Plotinus
    Replies:
    2
    Views:
    296
    Tad McClellan
    Dec 17, 2004
Loading...

Share This Page