Another possible bug related to this same problem. [please read below].
EntityInstanceInterceptor gets the mutex of the Entity's key before going
into the do..while loop. If a different thread/transaction rollsback, the
mutex gets detached from the EntityEnterpriseContext and the thread in the
do..while loop is acquiring a lock on a context that is not attached. Am I
missing something here?
I'd really like to go in and fix this problem, but I really need another set
of eyeballs to make sure I'm doing things right. Danch, can you volunteer
to help? Also, while I'm in this code, maybe I should consider adding the
"Missing wait/notify" and remove that buggy do..while loop as well.
Bill
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Bill
> Burke
> Sent: Wednesday, June 06, 2001 9:39 PM
> To: Jboss-Development@Lists. Sourceforge. Net
> Subject: [JBoss-dev] race condition between EntityInstanceInterceptor
> and InstanceSynchronization?
>
>
> 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
>
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development