Crazy Idea


Jdbc : Why doesn’t Oracle’s driver support READ_UNCOMMITTED ?
September 7, 2007, 6:56 pm
Filed under: Uncategorized

hi lazy Web,

I tried to change the Transaction Isolation level to see what my unit test(spring/hibernate/dbUnit) was doing.

Class.forName(“oracle.jdbc.driver.OracleDriver”);
Connection conn = java.sql.DriverManager.getConnection(url, user, password);
if (null != conn) {
System.out.printf(“%s%n”, conn.getTransactionIsolation());
conn.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
}

and got the following exception

2
Exception in thread “main” java.sql.SQLException: READ_COMMITTED and SERIALIZABLE are the only valid transaction levels
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
at oracle.jdbc.driver.PhysicalConnection.setTransactionIsolation(PhysicalConnection.java:1678)
at JdbcTest.main(JdbcTest.java:17)

So, why doesn’t Oracle JDBC driver let me do dirty reads ?

Does anyone out there know of a tool (java or otherwise) that can let me do this ? I have TOAD : does TOAD support a way to do this ? How about ruby/Python tools ? I’m on windows XP. So, it would help me if you could referĀ  me to windows specific OR cross-platform tools.

Thank you for any pointers,

Advertisements