2 Replies Latest reply on Dec 22, 2011 2:47 PM by 744235

    reg MDB transaction rollback

      i have an MDB deployed on weblogic 8.1 sp6 server. My confusion here is how the MDB handles transaction rollbacks. E.g suppose if the MDB is designed to do the below action.

      1) read an xml message from a jms queue
      2) insert some database records
      3) generate some xml message, post it to some other jms queue

      suppose if step 1 and 2 is completed, and its on step 3, at this point weblogic server shutdowns suddenly, once i restart the server, it reads the xml message again from the jms queue, but this time it errors out, because it finds the data already entered in step 2.

      My question is when the weblogic server shut down while the mdb was at step 3, why didnt it removed all the db entries it made in step 2. This behaviour apears to me as partial rollback. I have given the mdb descriptor below.
      Please clear my doubt.

      Edited by: Deepak Dev on 19-Dec-2011 11:01
        • 1. Re: reg MDB transaction rollback
          René van Wijk
          General information on message-driven beans can be found here: http://docs.oracle.com/cd/E12840_01/wls/docs103/ejb/message_beans.html

          To transaction configuration is discussed here: http://docs.oracle.com/cd/E12840_01/wls/docs103/ejb/message_beans.html#wp1162058

          Looks like you have to set the transaction-type to Container and the trans-attribute to required. Also see the note:
          - However, if you make this configuration error, the MDB will not run transactionally—if a failure occurs mid-transaction, updates that occurred prior to the failure will not be rolled back.
          • 2. Re: reg MDB transaction rollback
            the ejb already has the set transaction type set as container

            and the transaction attribute set as required