-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: JDBC transaction isolation level
PostPosted: Tue Jun 29, 2004 5:48 pm 
Beginner
Beginner

Joined: Wed Mar 17, 2004 4:13 pm
Posts: 21
Location: San Diego, CA
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)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 29, 2004 6:03 pm 
Beginner
Beginner

Joined: Wed Mar 17, 2004 4:13 pm
Posts: 21
Location: San Diego, CA
I tried running without DBCP and it worked fine. So, it must be something with DBCP.

I found this old post on the web from Gavin King in response to the same problem I have. It seems to suggest that the problem was fixed in an earlier version of hibernate.

Quote:
From: Gavin King
Subject: Re: [Hibernate] HELP: Hibernate and Oracle
Date: Fri, 22 Nov 2002 15:41:22 +0100 (CET)

--------------------------------------------------------------------------------
I've never seen this problem before, but it looks like Oracle doesn't like
the idea of calling

Connection.setTransactionIsolation()

after callong

Connection.setAutocommit(false)

This is not a problem for other platforms, but I will swap the order
anyway...


The entire message can be viewed here:
http://www.mail-archive.com/hibernate-devel@lists.sourceforge.net/msg00827.html

BTW, I'm using Hibernate 2.1
Oracle 8.1.6
DBCP 1.1


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 29, 2004 6:04 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
DBCP will be deprecated in the next major Hibernate version. Use Proxool or C3P0.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.