All,

I'm wondering if I've found a race condition bewteen
EntityInstanceInterceptor and
EntitySynchronizationInterceptor.InstanceSynchronization.

Scenario:
====================================================
Transaction A                               Transaction B

Grab and lock Entity 123
                                            Wait for Entity 123 to get
release from Trans A
                                            in EntityInstanceInterceptor

Rollback

in InstanceSynchronization.afterCompletion()
if (status == Status.STATUS_ROLLEDBACK ...
   call ctx.setTransaction(null);

                                            in EntityInstanceInterceptor:
                                            // Next code returns null
                                            Transaction tx =
ctx.getTransaction();
// remove from the cache
container.getInstanceCache().remove(ctx.getCacheKey());

// return to pool
container.getInstancePool().free(ctx);

                                            Thread continues with a freed
Context!!!!
======================================================

Am I missing something here?  How to fix if I'm not?

The reason I've been looking into this is because I'm seeing some very weird
behaviour where an EntityBean is totally out of whack with what is really
within the database. The EntityBean actually has the data of a different
EntityBean.  When I stop accessing this EntityBean after many different
calls within succession and within different transactions the problem
disappears after awhile and the EntityBean seems to revert to what is stored
within the database. My guess is that the Bean gets dump from the
InstanceCache.

Regards,
Bill



_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to