1 Reply Latest reply on Jul 21, 2002 12:18 AM by David Jencks

    LocalManagedConnection w/o transaction

    alan shields Newbie

      I'm having a spot of bother with managed database connections when running without transactions.

      The transaction manager appears to be alternately setting autocommit on/off for each query.

      As far as I can make out checkTransaction in org.jboss.resource.adapter.jdbc.local.LocalManagedConnection.java doesn't appear correct.

      ....
      if(jdbcAutoCommit && !con.getAutoCommit()) {
      con.setAutoCommit(true);
      return;
      }
      if(con.getAutoCommit()) {
      con.setAutoCommit(false);
      }
      .....

      doesn't this mean if jdbcAutoCommit is true and con.getAutoCommit() is true we will then turn off auto commit?


      Should it be more like below, or (more likely) am I missing a bigger picture (or just being stupid;)

      ....
      if(jdbcAutoCommit && !con.getAutoCommit()) {
      con.setAutoCommit(true);
      return;
      }
      if(!jdbcAutoCommit && con.getAutoCommit()) {
      con.setAutoCommit(false);
      }
      .....

      Cheers
      Alan Shields