HSQL doesn't support locking; short-circuiting tests that require pessimistic locking

git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@526005 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Patrick Linskey 2007-04-05 23:57:44 +00:00
parent 7f998f10f1
commit 57442b7059
2 changed files with 19 additions and 1 deletions

View File

@ -27,6 +27,7 @@ import org.apache.openjpa.persistence.FetchPlan;
import org.apache.openjpa.persistence.OpenJPAEntityManager;
import org.apache.openjpa.jdbc.sql.DBDictionary;
import org.apache.openjpa.jdbc.sql.DB2Dictionary;
import org.apache.openjpa.jdbc.sql.HSQLDictionary;
import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
public class TestIsolationLevelOverride
@ -43,6 +44,11 @@ public class TestIsolationLevelOverride
OpenJPAPersistence.cast(emf.createEntityManager());
DBDictionary dict = ((JDBCConfiguration) em.getConfiguration())
.getDBDictionaryInstance();
// hsql doesn't support locking; circumvent the test
if (dict instanceof HSQLDictionary)
return;
sql.clear();
try {
em.getTransaction().begin();

View File

@ -22,6 +22,10 @@ import org.apache.openjpa.persistence.test.SQLListenerTestCase;
import org.apache.openjpa.persistence.simple.AllFieldTypes;
import org.apache.openjpa.persistence.OpenJPAPersistence;
import org.apache.openjpa.persistence.FetchPlan;
import org.apache.openjpa.persistence.OpenJPAEntityManager;
import org.apache.openjpa.jdbc.sql.DBDictionary;
import org.apache.openjpa.jdbc.sql.HSQLDictionary;
import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
public class TestSelectForUpdateOverride
extends SQLListenerTestCase {
@ -34,7 +38,15 @@ public class TestSelectForUpdateOverride
}
public void testSelectForUpdateOverride() {
EntityManager em = emf.createEntityManager();
OpenJPAEntityManager em =
OpenJPAPersistence.cast(emf.createEntityManager());
DBDictionary dict = ((JDBCConfiguration) em.getConfiguration())
.getDBDictionaryInstance();
// hsql doesn't support locking; circumvent the test
if (dict instanceof HSQLDictionary)
return;
sql.clear();
try {
em.getTransaction().begin();