I trying to set the JDBC isolation level to READ_COMMITED using the property:
Code:
<!-- DB JDBC connection properties -->
<!-- Transaction isolation 2 = READ_COMMITTED -->
<property name="connection.isolation">2</property>
Hibernate is picking this up properly, but the code is generating an Oracle ORA-01453 error. Anyone have some advice on what I need to be doing to make this work?
The code works fine if I don't set a connection.isolation level. Also, I'm using DBCP for connection pooling.
Here is the log file and stack trace:
Code:
INFO [2004-06-29 02:34] (net.sf.hibernate.connection.DBCPConnectionProvider) - JDBC isolation level: READ_COMMITTED
INFO [2004-06-29 02:34] (net.sf.hibernate.transaction.TransactionManagerLookupFactory) - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
WARN [2004-06-29 02:34] (net.sf.hibernate.cfg.SettingsFactory) - Could not obtain connection metadata
java.sql.SQLException: ORA-01453: SET TRANSACTION must be first statement of transaction
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:854)
at oracle.jdbc.driver.OracleConnection.setTransactionIsolation(OracleConnection.java:1634)
at org.apache.commons.dbcp.DelegatingConnection.setTransactionIsolation(DelegatingConnection.java:269)
at org.apache.commons.dbcp.DelegatingConnection.setTransactionIsolation(DelegatingConnection.java:269)
at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setTransactionIsolation(PoolingDataSource.java:353)
at net.sf.hibernate.connection.DBCPConnectionProvider.getConnection(DBCPConnectionProvider.java:42)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1119)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:748)