Hello,

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:

<local-tx-datasource>
  |     <jndi-name>myDS</jndi-name>
  |     <connection-url>jdbc:oracle:thin:myhost:mydb</connection-url>
  |        <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
  |     <user-name>user</user-name>
  |    <password>pass</password>
  |     
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
  |     <track-statements>true</track-statements>
  |  </local-tx-datasource>

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());
  | if(rset.next()){
  |   //This prints 0
  |   logger.debug("COUNT of ROWS in TMP Table: " + rset.getInt("CNT"));
  | }
  | ....
Any pointers appreciated.

Tx
-Sib




View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3836716#3836716

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3836716



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to