User: patriot1burke
Date: 02/03/15 14:58:54
Modified: src/main/org/jboss/ejb/plugins BMPPersistenceManager.java
CMPPersistenceManager.java
Log:
fixed bug 529956 BMP cache zombies. bypass catch on findByPrimaryKey with commit
option B or C.
Revision Changes Path
1.37 +8 -3 jboss/src/main/org/jboss/ejb/plugins/BMPPersistenceManager.java
Index: BMPPersistenceManager.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/BMPPersistenceManager.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- BMPPersistenceManager.java 5 Mar 2002 18:41:47 -0000 1.36
+++ BMPPersistenceManager.java 15 Mar 2002 22:58:54 -0000 1.37
@@ -32,6 +32,7 @@
import org.jboss.logging.Logger;
import org.jboss.management.j2ee.CountStatistic;
import org.jboss.management.j2ee.TimeStatistic;
+import org.jboss.metadata.ConfigurationMetaData;
/**
* <description>
@@ -40,7 +41,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Rickard �berg</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Andreas Schaefer</a>
-* @version $Revision: 1.36 $
+* @version $Revision: 1.37 $
*
* <p><b>Revisions:</b>
* <p><b>20010709 andreas schaefer:</b>
@@ -76,6 +77,7 @@
HashMap createMethods = new HashMap();
HashMap postCreateMethods = new HashMap();
HashMap finderMethods = new HashMap();
+ private int commitOption;
private CountStatistic mCreate = new CountStatistic( "Create", "", "EJBs
created" );
private CountStatistic mRemove = new CountStatistic( "Remove", "", "EJBs
removed" );
@@ -84,7 +86,6 @@
private TimeStatistic mPassivate = new TimeStatistic( "Passivation", "ms",
"Passivation Time" );
private TimeStatistic mLoad = new TimeStatistic( "Load", "ms", "Load Time" );
private TimeStatistic mStore = new TimeStatistic( "Store", "ms", "Load Time" );
-
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
@@ -93,6 +94,8 @@
public void setContainer(Container c)
{
con = (EntityContainer)c;
+ ConfigurationMetaData configuration =
con.getBeanMetaData().getContainerConfiguration();
+ commitOption = configuration.getCommitOption();
}
public void create()
@@ -588,7 +591,9 @@
{
// Check if findByPrimaryKey
// If so we check if the entity is in cache first
- if (finderMethod.getName().equals("findByPrimaryKey"))
+ if (finderMethod.getName().equals("findByPrimaryKey")
+ && commitOption != ConfigurationMetaData.B_COMMIT_OPTION
+ && commitOption != ConfigurationMetaData.C_COMMIT_OPTION)
{
Object key = ctx.getCacheKey();
if (key == null)
1.40 +8 -2 jboss/src/main/org/jboss/ejb/plugins/CMPPersistenceManager.java
Index: CMPPersistenceManager.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/CMPPersistenceManager.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- CMPPersistenceManager.java 5 Mar 2002 18:41:48 -0000 1.39
+++ CMPPersistenceManager.java 15 Mar 2002 22:58:54 -0000 1.40
@@ -33,6 +33,7 @@
import org.jboss.management.j2ee.CountStatistic;
import org.jboss.management.j2ee.TimeStatistic;
+import org.jboss.metadata.ConfigurationMetaData;
/**
* The CMP Persistence Manager implements the semantics of the CMP
@@ -45,7 +46,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Dan Christopherson</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Bill Burke</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Andreas Schaefer</a>
- * @version $Revision: 1.39 $
+ * @version $Revision: 1.40 $
*
* Revisions:
* 20010621 Bill Burke: removed loadEntities call because CMP read-ahead is now
@@ -73,6 +74,7 @@
HashMap createMethods = new HashMap();
HashMap postCreateMethods = new HashMap();
+ private int commitOption;
private CountStatistic mCreate = new CountStatistic( "Create", "", "EJBs
created" );
private CountStatistic mRemove = new CountStatistic( "Remove", "", "EJBs
removed" );
@@ -92,6 +94,8 @@
con = (EntityContainer)c;
if (store != null)
store.setContainer(c);
+ ConfigurationMetaData configuration =
con.getBeanMetaData().getContainerConfiguration();
+ commitOption = configuration.getCommitOption();
}
/**
@@ -291,7 +295,9 @@
throws Exception
{
// For now only optimize fBPK
- if (finderMethod.getName().equals("findByPrimaryKey"))
+ if (finderMethod.getName().equals("findByPrimaryKey")
+ && commitOption != ConfigurationMetaData.B_COMMIT_OPTION
+ && commitOption != ConfigurationMetaData.C_COMMIT_OPTION)
{
Object key = ctx.getCacheKey();
if (key == null)
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development