User: fleury
Date: 00/08/24 18:59:23
Modified: src/main/org/jboss/ejb/plugins
EntitySynchronizationInterceptor.java
Log:
The Synchronization works with the cache through the cache key
Revision Changes Path
1.12 +9 -6
jboss/src/main/org/jboss/ejb/plugins/EntitySynchronizationInterceptor.java
Index: EntitySynchronizationInterceptor.java
===================================================================
RCS file:
/products/cvs/ejboss/jboss/src/main/org/jboss/ejb/plugins/EntitySynchronizationInterceptor.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- EntitySynchronizationInterceptor.java 2000/08/18 03:20:56 1.11
+++ EntitySynchronizationInterceptor.java 2000/08/25 01:59:23 1.12
@@ -48,7 +48,7 @@
* @see <related>
* @author Rickard �berg ([EMAIL PROTECTED])
* @author <a href="mailto:[EMAIL PROTECTED]">Marc Fleury</a>
-* @version $Revision: 1.11 $
+* @version $Revision: 1.12 $
*/
public class EntitySynchronizationInterceptor
extends AbstractInterceptor
@@ -170,9 +170,9 @@
}
// So we can go on with the invocation
-
+ Logger.log("Tx is "+tx.toString());
if (tx != null &&
- tx.getStatus() == Status.STATUS_ACTIVE) {
+ tx.getStatus() == Status.STATUS_ACTIVE) {
try {
@@ -257,12 +257,14 @@
// Synchronization implementation -----------------------------
public void beforeCompletion()
{
- try
+
+ Logger.log("beforeCompletion called");
+ try
{
try
{
// Lock instance
- ((EntityContainer)getContainer()).getInstanceCache().get(ctx.getId());
+
((EntityContainer)getContainer()).getInstanceCache().get(((EntityEnterpriseContext)
ctx).getCacheKey());
// Store instance if business method was
if (((EntityEnterpriseContext) ctx).isInvoked())
@@ -287,6 +289,7 @@
public void afterCompletion(int status)
{
+ Logger.log("afterCompletion called");
// If rolled back -> invalidate instance
if (status == Status.STATUS_ROLLEDBACK)
{
@@ -348,7 +351,7 @@
try
{
//Lock in cache
- container.getInstanceCache().get(ctx.getId());
+
container.getInstanceCache().get(((EntityEnterpriseContext)ctx).getCacheKey());
// Passivate instance
((EntityContainer)getContainer()).getPersistenceManager().passivateEntity((EntityEnterpriseContext)ctx);