diff --git a/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/sql-error-state-codes.xml b/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/sql-error-state-codes.xml index 72da6d2e8..598802bae 100644 --- a/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/sql-error-state-codes.xml +++ b/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/sql-error-state-codes.xml @@ -49,7 +49,7 @@ 1204,1205,1222 544,2601,2627,8114,8115 - + 23000 1205 HY008 diff --git a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/TestException.java b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/TestException.java index a9777d6c2..e61d02db2 100644 --- a/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/TestException.java +++ b/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/TestException.java @@ -202,9 +202,15 @@ public class TestException extends SingleEMFTestCase { */ public void assertException(Throwable t, Class expectedType) { if (!isExpectedException(t, expectedType)) { - t.printStackTrace(); + getLog().error("TestException.assertException() - unexpected exception type", t); + //t.printStackTrace(); print(t, 0); fail(t + " or its cause is not instanceof " + expectedType); + } else { + if (getLog().isTraceEnabled()) { + getLog().trace("TestException.assertException() - caught expected exception type=" + + expectedType, t); + } } } @@ -222,11 +228,14 @@ public class TestException extends SingleEMFTestCase { void print(Throwable t, int tab) { if (t == null) return; - for (int i=0; i