geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r797215 - /geronimo/specs/trunk/geronimo-jpa_2.0_spec/src/main/java/javax/persistence/Persistence.java
Date Thu, 23 Jul 2009 20:41:31 GMT
Author: dwoods
Date: Thu Jul 23 20:41:31 2009
New Revision: 797215

URL: http://svn.apache.org/viewvc?rev=797215&view=rev
Log:
GERONIMO-4410 - OPENJPA-1076 Catch any createEMF() exceptions and rethrow as a PersistenceException
to maintain behavior with prior 1.0 impl for now....

Modified:
    geronimo/specs/trunk/geronimo-jpa_2.0_spec/src/main/java/javax/persistence/Persistence.java

Modified: geronimo/specs/trunk/geronimo-jpa_2.0_spec/src/main/java/javax/persistence/Persistence.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jpa_2.0_spec/src/main/java/javax/persistence/Persistence.java?rev=797215&r1=797214&r2=797215&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-jpa_2.0_spec/src/main/java/javax/persistence/Persistence.java
(original)
+++ geronimo/specs/trunk/geronimo-jpa_2.0_spec/src/main/java/javax/persistence/Persistence.java
Thu Jul 23 20:41:31 2009
@@ -105,8 +105,13 @@
                 PersistenceProviderResolverHolder.getPersistenceProviderResolver();
             List<PersistenceProvider> providers = resolver.getPersistenceProviders();
             for (PersistenceProvider provider : providers) {
-                factory = provider.createEntityManagerFactory(
-                    persistenceUnitName, properties);
+                try {
+                    factory = provider.createEntityManagerFactory(
+                        persistenceUnitName, properties);                    
+                } catch (Exception e) {
+                    // TODO - Grey area of Spec - mimic old 1.0 behavior for now
+                    throw new PersistenceException("Provider error. Provider: " + providerName,
e);
+                }
                 if (factory != null) {
                     break;
                 }



Mime
View raw message