We are using Tibco JMS and Weblogic 7.0.
We have a MDB that takes message and calls
a stateless session bean which does business processing,
( oracle database to be included in transaction later)
and publishes on JMS for downstream process.
We desire all these operations in one transaction.
Please comment/advise on the following settings:
1. XATopicConnectionFactory is created in tibjms server.
2. In the MDB, set it as container managed with
transaction attribute as Required.
Call the session bean. When any exceptions are
caught invoke mdbContext.setRollBackOnly().
3. Session bean has container managed transaction
with Required attribute. Shoud it use
javax.jms.XAConnection and XAConnectionFactory or the
regular Connection,ConnectionFactory and Session
classes to lookup the connectionFactory to publish to
the downstream process?
4. In the javax.jms.Session/XASession - I guess we should
be setting the transacted option to be false.
topicConnection.createTopicSession(false,AUTO_ACK..);
I am bit confused as to how to link the MDB transaction
with the session bean transaction with the JMS publisher
and ultimately the database process.
Thanks in advance for your insights and help,
Venkat
-
MDB->Session Bean -> JMS - Transaction question (2 messages)
- Posted by: Venkat Subramani
- Posted on: November 27 2002 13:36 EST
Threaded Messages (2)
- MDB->Session Bean -> JMS - Transaction question by Glen Klyuzner on December 06 2002 20:31 EST
- MDB->Session Bean -> JMS - Transaction question by Jordi Domingo on March 25 2005 16:52 EST
-
MDB->Session Bean -> JMS - Transaction question[ Go to top ]
- Posted by: Glen Klyuzner
- Posted on: December 06 2002 20:31 EST
- in response to Venkat Subramani
From the EJB 2.0 specification: "An onMessage call is always a separate transaction, because there is never a transaction in progress when the method is called."
When a message arrives, it is passed to the Message Driven Bean through the onMessage() method, that is where the business logic goes.
Since there is no guarantee when the method is called and when the message will be processed, is the container that is responsible of managing the environment, including transactions. -
MDB->Session Bean -> JMS - Transaction question[ Go to top ]
- Posted by: Jordi Domingo
- Posted on: March 25 2005 16:52 EST
- in response to Glen Klyuzner
The J2EE 1.3 Spec says that a JMS transaction with an XA resource adaptor and an JDBC XA driver can be commited or rollback within the same transaction.
Obviously, when the mdb is called, this is done in a non transactional context, but in his (optionally) new transaction context so calls to other beans can participate.