Author: steve.ebersole(a)jboss.com
Date: 2007-08-17 14:45:35 -0400 (Fri, 17 Aug 2007)
New Revision: 13932
Modified:
core/branches/Branch_3_2/test/org/hibernate/junit/functional/FunctionalTestCase.java
core/branches/Branch_3_2/test/org/hibernate/test/legacy/MasterDetailTest.java
Log:
skip org.hibernate.test.legacy.MasterDetailTest#testCachedCollectionRefresh when
connection is enforcing (at least) serializable isolation
Modified:
core/branches/Branch_3_2/test/org/hibernate/junit/functional/FunctionalTestCase.java
===================================================================
---
core/branches/Branch_3_2/test/org/hibernate/junit/functional/FunctionalTestCase.java 2007-08-17
04:04:34 UTC (rev 13931)
+++
core/branches/Branch_3_2/test/org/hibernate/junit/functional/FunctionalTestCase.java 2007-08-17
18:45:35 UTC (rev 13932)
@@ -4,6 +4,7 @@
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
+import java.sql.Connection;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Mappings;
@@ -278,8 +279,30 @@
}
+ /**
+ * Do connections enforce SERIALIZABLE isolation...
+ *
+ * @return
+ * @throws Exception
+ */
+ protected boolean isSerializableIsolationEnforced() throws Exception {
+ Connection conn = null;
+ try {
+ conn = sfi().getConnectionProvider().getConnection();
+ return conn.getTransactionIsolation() >= Connection.TRANSACTION_SERIALIZABLE;
+ }
+ finally {
+ if ( conn != null ) {
+ try {
+ sfi().getConnectionProvider().closeConnection( conn );
+ }
+ catch ( Throwable ignore ) {
+ // ignore...
+ }
+ }
+ }
+ }
-
/**
* Is connection at least read committed?
* <p/>
Modified: core/branches/Branch_3_2/test/org/hibernate/test/legacy/MasterDetailTest.java
===================================================================
---
core/branches/Branch_3_2/test/org/hibernate/test/legacy/MasterDetailTest.java 2007-08-17
04:04:34 UTC (rev 13931)
+++
core/branches/Branch_3_2/test/org/hibernate/test/legacy/MasterDetailTest.java 2007-08-17
18:45:35 UTC (rev 13932)
@@ -3,6 +3,7 @@
import java.io.Serializable;
import java.sql.Connection;
+import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
@@ -835,6 +836,10 @@
}
public void testCachedCollectionRefresh() throws Exception {
+ if ( isSerializableIsolationEnforced() ) {
+ reportSkip( "SERIALIZABLE isolation", "cached collection
refreshing" );
+ return;
+ }
Session s = openSession();
Category c = new Category();
List list = new ArrayList();
@@ -853,7 +858,9 @@
s.close();
s = openSession();
- if ( (getDialect() instanceof MySQLDialect) )
s.connection().setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+ if ( (getDialect() instanceof MySQLDialect) ) {
+ s.connection().setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+ }
c = (Category) s.load(Category.class, id);
c.getSubcategories().size(); //force load
Show replies by date