how to activate a transaction in MDB dev?

Discussions

EJB programming & troubleshooting: how to activate a transaction in MDB dev?

  1. how to activate a transaction in MDB dev? (5 messages)

    I met a problem when the MDBs running,there're always warning as follows.How can I config to solve it?
    Thanks a lot.

    [11/27/03 10:38:18:438 PST] 52e79206 ConnectionMan W J2CA0075W: An active transaction should be present while processing method allocateMCWrapper.

    [11/27/03 10:38:18:469 PST] 52e79206 ConnectionMan W J2CA0075W: An active transaction should be present while processing method initializeForUOW.
  2. You should give more details on these cases. Maybe in your onMessage() method in your MDBs you are doing some actions on a database and these are not executed inside a transaction. For example your MDBs are using some entities in order to store some data inside the database. If so, the entity beans should run inside a transaction. Check inside the ejb-jar.xml files that the <trans-attribute> for those methods is Required. In this case, if there is no transaction already running when the entities are called, a new transaction is started.

      If you could give more details on your problem maybe we can help you. Here I just guessed your case so this may not be the case and solution

      Sergiu.
  3. FYI, if you start a transaction inside your MDBs then do some database operation you will get the following WARNING:

    "WARN [LocalTxConnectionManager] prepare called on a local tx. You are not getting the semantics you expect!"

     This is because you get a message and do database operations inside the same transactions.
  4. first of all,thanks a lot for your timely reply.
    In fact,I've no database operation in my onMessage().It seems that there's something wrong with my configuration for QueueConnectionFactory.Everytime when I use QueueConnectionFactory to send message,there will be this warning.I don't quite clear about it.And if this warning accumulated,the JMS server will crash.No connection will be get anymore.:(
  5. Give me your email and I shall send you a simple example with a MDB and a client and how to use it in JBoss(by the way, you didn't say what app server you are using.)
  6. Thanks a lot.
    I'm using WAS5.0,my mail:[email protected]