6 Replies Latest reply on Jun 2, 2004 12:58 PM by Holger Baxmann

    Not able to see uncommitted updates made within same oracle

    Sib Chatterjee Newbie


      Code that worked fine under commns-dbcp is not working under jboss. Essentially subsequent read after write in same transaction is not seeing the records written. Oracle's default behavior is to be able to see updates made within same transaction even though not commited. Not sure why we are seing this in Jboss.

      Data Source config:



      Code snippet:

      Connection con = null;
      ResultSet rset = null;
      InitialContext initctx = new InitialContext();
      DataSource ds = (DataSource)initctx.lookup("java:/myDS");
      con = ds.getConnection();
      if (con != null)
       Statement stmt = con.createStatement();
       stmt.execute(insertQuery); //inserts records in a temp_keys table
       int updateCount = stmt.getUpdateCount();
      //This prints count fine
       logger.debug("Update count:" + updateCount);
       String testQuery = "Select count(*) as CNT from TMP_KEYS";
       rset = stmt.executeQuery(testQuery);
      //This Prints -1
       logger.debug("COUNT TMP TABLE: " + stmt.getUpdateCount());
       //This prints 0
       logger.debug("COUNT of ROWS in TMP Table: " + rset.getInt("CNT"));

      Any pointers appreciated.