EJB programming & troubleshooting: MDB transaction configuration
I am new to JMS and MDB concepts and I need help with the following problem (server is WebLogic 702):
- Posted by: zlata jovanovic
- Posted on: October 30 2004 00:21 EDT
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.
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.
You have to define the transaction attribute in the ejb-jar.xml as follows:
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
Hope this helps
When would you use 'Not supported' for the transaction type?