openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r918748 - /openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java
Date Wed, 03 Mar 2010 22:50:55 GMT
Author: ppoddar
Date: Wed Mar  3 22:50:55 2010
New Revision: 918748

URL: http://svn.apache.org/viewvc?rev=918748&view=rev
Log:
OPENJPA-1503: Throw persistence exception not illegalargument exception as per spec when fails
to unwrap()

Modified:
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java?rev=918748&r1=918747&r2=918748&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java
Wed Mar  3 22:50:55 2010
@@ -1634,8 +1634,10 @@
         }
         // Set this transaction to rollback only (as per spec) here because the raised exception

         // does not go through normal exception translation pathways
-        RuntimeException ex = new IllegalArgumentException(_loc.get("unwrap-em-invalid",
cls).toString());
-        setRollbackOnly(ex);
+        RuntimeException ex = new PersistenceException(_loc.get("unwrap-em-invalid", cls).toString(),
null, 
+                this, false);
+        if (isActive())
+            setRollbackOnly(ex);
         throw ex;
     }
 



Mime
View raw message