[jboss-cvs] JBossAS SVN: r62113 - branches/Branch_5_0/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:52:16 EDT 2007


Author: scott.stark at jboss.org
Date: 2007-04-04 22:52:16 -0400 (Wed, 04 Apr 2007)
New Revision: 62113

Modified:
   branches/Branch_5_0/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: branches/Branch_5_0/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/bridge/JDBCCMRFieldBridge2.java
===================================================================
--- branches/Branch_5_0/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/bridge/JDBCCMRFieldBridge2.java	2007-04-05 02:46:16 UTC (rev 62112)
+++ branches/Branch_5_0/server/src/main/org/jboss/ejb/plugins/cmp/jdbc2/bridge/JDBCCMRFieldBridge2.java	2007-04-05 02:52:16 UTC (rev 62113)
@@ -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