1 Reply Latest reply on Nov 1, 2001 11:17 PM by David Jencks

    TransactionIsolation and setAutoCommit with JBoss 2.4.3

    genri Newbie

      I am porting some working application in weblogic 6.0 into JBoss 2.4.3...In Session EJB-s, in most of the cases, is used setAutoCommit(false) after the Connection is taken through the DataSource .The Connection is reused several times within the same method until the end when conn.commit() is called (or rollback())...I have noticed that the DataSource of the driver is wrapped in JBoss making the Connection not sharable. This means that the setAutoCommit(false) (which is the default) always throws an Exception.
      Looking at the source of the wrapper you notice that only in case that TransactionIsolation is '-1' the wrapper does not set the TransactionIsolation...(it uses the driver's default it says)
      What is the constant to be used for this '-1' value..?
      Even in the case of '-1' is the Connection sharable...?
      Having to get new Connections from the DataSource everytime you need to do something meanas chaning lots of existing code...
      Any idea will be appreciated..

        • 1. Re: TransactionIsolation and setAutoCommit with JBoss 2.4.3
          David Jencks Master

          The connections from the jboss XADataSourceLoader already have Autocommit= false. Are you using BMT? if so, why? What do you mean by "not sharable"? Transaction isolation has nothing to do with autocommit. If you don't set an autocommit value explicitly, the driver default (often read committed) is used.

          In jboss at the moment you must get a connection after the beginning of a transaction and close it (really, return it to the pool) before the end of the transaction. With CMT, this means obtaining and closing the connection within each method call.