I am new to JMS and MDB concepts and I need help with the following problem (server is WebLogic 702):
JMS producer sends a message to a queue. MDB receives a message and calls a session ejb method to process a file. Message should be sent only once. File is processed in such a way that a number of lines is parsed, validated and loaded into a table of the database. I don't know how to configure the transaction management attributes of the MDB and EJB. The EJB should have a Container managed transaction setting with Never or Not Supported attribute, because batches of file processing should not be inside a transaction. Any suggestion is highly appreciated.
Zlata
-
MDB transaction configuration (3 messages)
- Posted by: zlata jovanovic
- Posted on: October 30 2004 00:21 EDT
Threaded Messages (3)
- MDB transaction configuration by Zurdo 1119 on November 02 2004 08:02 EST
- MDB transaction configuration by Debu Panda on November 04 2004 14:36 EST
- MDB transaction configuration by david lightman on November 29 2004 09:37 EST
-
MDB transaction configuration[ Go to top ]
- Posted by: Zurdo 1119
- Posted on: November 02 2004 08:02 EST
- in response to zlata jovanovic
From http://www.theserverside.com/articles/article.tss?l=Pramati-MDB
What is a Message Driven Bean?
A message driven bean is a stateless, server-side, transaction-aware component that is driven by a Java message (javax.jms.message). It is invoked by the EJB Container when a message is received from a JMS Queue or Topic. It acts as a simple message listener.
-
MDB transaction configuration[ Go to top ]
- Posted by: Debu Panda
- Posted on: November 04 2004 14:36 EST
- in response to Zurdo 1119
You have to define the transaction attribute in the ejb-jar.xml as follows:
<container-transaction>
<method>
<ejb-name>PSsimpleMdb</ejb-name>
<method-name>onMessage</method-name>
<method-params>
<method-param>javax.jms.Message</method-param>
</method-params>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
Only Required or NotSupported is supported with MDB
Here is a sample MDB application
http://www.oracle.com/technology/tech/java/oc4j/904/how_to/how-to-ejb-mdb.zip - Here is a sample MDB
Here is an article I wrote on MDB using JCAResource Adapter
http://www.onjava.com/pub/a/onjava/2004/06/23/mdbjca.html
Hope this helps
regards
Debu Panda
http://radio.weblogs.com/0135826 -
MDB transaction configuration[ Go to top ]
- Posted by: david lightman
- Posted on: November 29 2004 09:37 EST
- in response to zlata jovanovic
When would you use 'Not supported' for the transaction type?