[jbosstools-commits] JBoss Tools SVN: r43488 - in workspace/akazakov/db: org.jboss.tools.common.db/src/org/jboss/tools/common/db and 1 other directory.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Thu Sep 6 20:02:04 EDT 2012


Author: akazakov
Date: 2012-09-06 20:02:04 -0400 (Thu, 06 Sep 2012)
New Revision: 43488

Removed:
   workspace/akazakov/db/org.jboss.tools.cdi.db/src/org/jboss/tools/cdi/db/DBCDIProject.java
Modified:
   workspace/akazakov/db/org.jboss.tools.common.db/src/org/jboss/tools/common/db/AbstractDBManager.java
Log:
https://issues.jboss.org/browse/JBIDE-12446

Deleted: workspace/akazakov/db/org.jboss.tools.cdi.db/src/org/jboss/tools/cdi/db/DBCDIProject.java
===================================================================
--- workspace/akazakov/db/org.jboss.tools.cdi.db/src/org/jboss/tools/cdi/db/DBCDIProject.java	2012-09-06 23:31:51 UTC (rev 43487)
+++ workspace/akazakov/db/org.jboss.tools.cdi.db/src/org/jboss/tools/cdi/db/DBCDIProject.java	2012-09-07 00:02:04 UTC (rev 43488)
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.cdi.db;
-
-import java.util.Collection;
-
-import org.jboss.tools.cdi.core.IBean;
-import org.jboss.tools.cdi.core.IInjectionPoint;
-import org.jboss.tools.cdi.internal.core.impl.CDIProject;
-
-/**
- * @author Alexey Kazakov
- */
-public class DBCDIProject extends CDIProject {
-
-	/* (non-Javadoc)
-	 * @see org.jboss.tools.cdi.internal.core.impl.CDIProject#getBeans(boolean, org.jboss.tools.cdi.core.IInjectionPoint)
-	 */
-	@Override
-	public Collection<IBean> getBeans(
-			boolean attemptToResolveAmbiguousDependency,
-			IInjectionPoint injectionPoint) {
-		return super.getBeans(attemptToResolveAmbiguousDependency, injectionPoint);
-	}
-}
\ No newline at end of file

Modified: workspace/akazakov/db/org.jboss.tools.common.db/src/org/jboss/tools/common/db/AbstractDBManager.java
===================================================================
--- workspace/akazakov/db/org.jboss.tools.common.db/src/org/jboss/tools/common/db/AbstractDBManager.java	2012-09-06 23:31:51 UTC (rev 43487)
+++ workspace/akazakov/db/org.jboss.tools.common.db/src/org/jboss/tools/common/db/AbstractDBManager.java	2012-09-07 00:02:04 UTC (rev 43488)
@@ -34,6 +34,7 @@
 	protected String url;
 
 	protected EntityManagerFactory emf;
+	protected EntityManager em;
 
 	protected abstract String getEntityManagerFactoryName();
 
@@ -54,7 +55,7 @@
 		init();
 	}
 
-	public EntityManager createEntityManager() {
+	public EntityManager getEntityManager() {
 		try {
 			start();
 		} catch (InstantiationException e) {
@@ -66,7 +67,9 @@
 		} catch (SQLException e) {
 			CommonDbPlugin.getDefault().logError(e);
 		}
-		EntityManager em = emf.createEntityManager();
+		if(em==null || !em.isOpen()) {
+			em = emf.createEntityManager();
+		}
 		return em;
 	}
 



More information about the jbosstools-commits mailing list