From: <ste...@us...> - 2006-02-17 03:13:30
|
Update of /cvsroot/hibernate/Hibernate3/test/org/hibernate/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19281/test/org/hibernate/test Modified Files: TestCase.java Log Message: read-committed isolation protections Index: TestCase.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate3/test/org/hibernate/test/TestCase.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- TestCase.java 12 Feb 2006 14:29:21 -0000 1.27 +++ TestCase.java 17 Feb 2006 03:13:25 -0000 1.28 @@ -11,6 +11,7 @@ import org.hibernate.HibernateException; import org.hibernate.Interceptor; import org.hibernate.SessionFactory; +import org.hibernate.Session; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; import org.hibernate.dialect.DB2Dialect; @@ -258,6 +259,33 @@ protected static final Log SKIP_LOG = LogFactory.getLog("org.hibernate.test.SKIPPED"); + protected boolean readCommittedIsolationMaintained(String scenario) { + int isolation = java.sql.Connection.TRANSACTION_READ_UNCOMMITTED; + Session testSession = null; + try { + testSession = openSession(); + isolation = testSession.connection().getTransactionIsolation(); + } + catch( Throwable ignore ) { + } + finally { + if ( session != null ) { + try { + session.close(); + } + catch( Throwable ignore ) { + } + } + } + if ( isolation < java.sql.Connection.TRANSACTION_READ_COMMITTED ) { + reportSkip( "environment does not support at least read committed isolation", scenario ); + return false; + } + else { + return true; + } + } + protected boolean dialectSupportsEmptyInList(String testdescription) { return reportSkip( "Dialect does not support SQL: \'x in ()\'.", testdescription, dialectIsNot(new Class[] { Oracle9Dialect.class, |