juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfa...@apache.org
Subject svn commit: r776512 - /webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/PersistenceManager.java
Date Wed, 20 May 2009 01:01:41 GMT
Author: jfaath
Date: Wed May 20 01:01:41 2009
New Revision: 776512

URL: http://svn.apache.org/viewvc?rev=776512&view=rev
Log:
removing static init of PersistenceManager as it would cause a double call in certain situations.

Modified:
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/PersistenceManager.java

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/PersistenceManager.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/PersistenceManager.java?rev=776512&r1=776511&r2=776512&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/PersistenceManager.java
(original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/PersistenceManager.java
Wed May 20 01:01:41 2009
@@ -30,10 +30,10 @@
 	public static final String PERSISTENCE_UNIT_NAME = "juddiDatabase";
 
 	private static EntityManagerFactory emf;
-	
-	// Now, the factory will be initialized in the config. This will force the config to initialize,
thereby initializing emf.
-	static {
+
+	public static EntityManager getEntityManager() {
 		try {
+			// Now, the factory will be initialized in the config. This will force the config to initialize,
thereby initializing emf.
 			if (emf == null)
 				AppConfig.getInstance();
 		} 
@@ -41,9 +41,7 @@
 			log.error("Error initializing config in PersistenceManager", e);
 			throw new ExceptionInInitializerError(e);
 		}
-	}
-
-	public static EntityManager getEntityManager() {
+		
 		return emf.createEntityManager();
 	}
 	



---------------------------------------------------------------------
To unsubscribe, e-mail: juddi-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: juddi-cvs-help@ws.apache.org


Mime
View raw message