1 Reply Latest reply on Apr 16, 2008 7:56 AM by vinayh

    jboss transactions query

    vinayh

      Hi,

      Using JBoss 4.2 GA, MySQL DB 5.0, MySql Connector/J v5.1.5.

      Problem:

      I am having a client application (POJO) which inserts data into a database and then invokes an SLSB method by passing the ID of the inserted data. The SLSB tries to retreive the record from the database using JDBC.

      The database connection is obtained using the datasource object from the JNDI.

      For transaction integrity I am beginning a transaction in the client by getting a UserTransaction object from the JNDI and starting the txn using the begin().

      I insert the data into the database and invoke the SLSB method.

      The SLSB method tries to retreive the inserted record but does not find the same as the transaction is yet to be committed. The SLSB txn-attribute is set to "Mandatory".

      I am using the MySql driver com.mysql.jdbc.Driver and not the XA driver as I am having only a single database.

      Please let me know if I begin a transaction in the client (different JVM) will the transaction be propogated to the JBoss AS JVM?

      If not then please help me in suggesting an alternative solution.

      TIA
      Vinay

        • 1. Re: jboss transactions query
          vinayh

          Hi,

          Some corrections...

          The DML statements do not participate in the txn eventhough I have started a txn using the UserTransaction().begin() method.


          Best Regards,
          Vinay