[jboss-cvs] JBossAS SVN: r109882 - projects/jpa/trunk/deployers/src/main/java/org/jboss/jpa/deployers/switchboard.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Dec 13 15:41:13 EST 2010
Author: smarlow at redhat.com
Date: 2010-12-13 15:41:11 -0500 (Mon, 13 Dec 2010)
New Revision: 109882
Modified:
projects/jpa/trunk/deployers/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceContextRefResource.java
Log:
JBJPA-33
Modified: projects/jpa/trunk/deployers/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceContextRefResource.java
===================================================================
--- projects/jpa/trunk/deployers/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceContextRefResource.java 2010-12-13 18:39:15 UTC (rev 109881)
+++ projects/jpa/trunk/deployers/src/main/java/org/jboss/jpa/deployers/switchboard/PersistenceContextRefResource.java 2010-12-13 20:41:11 UTC (rev 109882)
@@ -63,15 +63,26 @@
return puSupplier;
}
+ /**
+ * The PersistenceContext (PC) for a bean, is the EntityManager (EM) that
+ * will be used to access it. Think of potentially, separate EM per bean
+ * in the transaction but possibly the same Database connection shared for
+ * each EM (via EE sharing of managed connections).
+ *
+ * The Extended PersistenceContext (XPC) identifies the EM to use for a set
+ * of session bean invocations that also reference the same XPC. Think of
+ * one EM per transaction for the session beans.
+ *
+ * @return an object that can be bound that represents the target PersistentContext.
+ */
@Override
public Object getTarget()
{
+ // TODO: both of the following cases are wrong and a deeper fix is needed that addresses
+ // how we manage the PersistenceContext
boolean extendedPc = PersistenceContextType.EXTENDED.equals(pcRef.getPersistenceContextType());
if (extendedPc)
{
- // clearly this is wrong, since the non-extended case returns a factory that can be bound.
- // hmm, I wonder if the else case already has the knowledge to return a factory that later returns
- // the extended PC
return PersistenceUnitRegistry.getPersistenceUnit(puSupplier).getXPCResolver().getExtendedPersistenceContext(puSupplier);
}
else
More information about the jboss-cvs-commits
mailing list