1 Reply Latest reply on Dec 20, 2005 5:40 PM by Atul Kshatriya

    transaction not committed after ejbCreate

    Atul Kshatriya Newbie

      I am using JBoss 4.02 with Oracle 91 (XA datasource). I have a BMP EJB. I can see that after I create a new instance (ejbCreate called) a record gets inserted in the db - since there is not exception thrown. But the transaction does not get committed. For that reason the record does not get reflected in future queries (or even from outside the application server). But if I shut down JBoss server then the records appear - meaning the data gets comitted.

      Why does this occur? Shouldn't the container commit the transaction immediately after the ejbCreate return?

      Thanks for your response in advance.


        • 1. Re: transaction not committed after ejbCreate
          Atul Kshatriya Newbie

          Okay. I have found how to resolve my issue. The original issue still remains.

          I had followed the jboss official documentation to setup the Oracle 9i data source. This tells to setup an xa datasource.


          This was giving me the issue. My EJBs could write the data to the db but the transaction was not comitted by the container and the data was not reflected until I stop the server wherein all commits would seemingly be done and the data became visible. The data was not visible even to other ejbs in the application when the server was running.

          Then I thought of trying the normal datasource. So I followd the documentation on the wiki to setup a regular datasource.


          And viola my application started to run fine.

          So the issue still remains why does the xa datasource behave that way? Am I missing some configuration that I need to do to tell it to commit?

          If anybody ever finds it out please do reply. For reference I am giving both ot the blocks of my configuration.

          this one works ---



          <!-- Checks the Oracle error codes and messages for fatal errors -->



          this one does not ---

          <xa-datasource-property name="URL">
          <xa-datasource-property name="User">user</xa-datasource-property>
          <xa-datasource-property name="Password">pwd</xa-datasource-property>