[jboss-cvs] JBossAS SVN: r62114 - trunk/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/bridge.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Apr 4 22:55:06 EDT 2007
Author: scott.stark at jboss.org
Date: 2007-04-04 22:55:06 -0400 (Wed, 04 Apr 2007)
New Revision: 62114
Modified:
trunk/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/bridge/JDBCCMRFieldBridge2.java
Log:
JBAS-4295, throw an exception with a message explaining the problem rather than allowing an NPE
Modified: trunk/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/bridge/JDBCCMRFieldBridge2.java
===================================================================
--- trunk/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/bridge/JDBCCMRFieldBridge2.java 2007-04-05 02:52:16 UTC (rev 62113)
+++ trunk/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/bridge/JDBCCMRFieldBridge2.java 2007-04-05 02:55:06 UTC (rev 62114)
@@ -1082,6 +1082,10 @@
private void loadOnlyFromCache(EntityEnterpriseContext ctx)
{
PersistentContext pctx = (PersistentContext)ctx.getPersistenceContext();
+ if(pctx == null)
+ {
+ throw new EJBException("Persistence context is not available! Make sure the CMR collection is accessed in the transaction it was obtained.");
+ }
pctx.loadCachedRelations(cmrIndex, this);
}
More information about the jboss-cvs-commits
mailing list