The instance interceptors role is to acquire a context representing
the target object from the cache.
This particular container interceptor implements pessimistic locking
on the transaction that is associated with the retrieved instance. If
there is a transaction associated with the target component and it is
different from the transaction associated with the MethodInvocation
coming in then the policy is to wait for transactional commit.
We also implement serialization of calls in here (this is a spec
requirement). This is a fine grained notify, notifyAll mechanism. We
notify on ctx serialization locks and notifyAll on global transactional
locks.
WARNING: critical code, get approval from senior developers
before changing.
Version:
$Revision: 1.30.2.8 $
Revisions:
2001/06/28: marcf
Moved to new synchronization
Pools are gone simple design
two levels of syncrhonization with Tx and ctx
remove busy wait from previous mechanisms
2001/07/11: starksm
Fix a thread starvation problem due to incomplete condition notification
Add support for trace level diagnositics
2001/07/12: starksm
Handle a race condition when there is no ctx transaction
2001/07/16: billb
Added wait(timeout) code, commented out so that we can easily turn it on
when this new code is done with it's trial period.
Fixed bug when ejbLoad threw an exception and threads waiting
on TxLock did not get awakened.
2001/07/26: billb
Locking is now separate from EntityEnterpriseContext objects and is now
encapsulated in BeanLock and BeanLockManager. Did this because the lifetime
of an EntityLock is sometimes longer than the lifetime of the ctx.
2001/08/1: marcf
Taking the lock out pointed to something new, the fact that the locking policies
can be fully automated and factored out of the instance interceptor this results in a
new interceptor EntityLockInterceptor that by design sits in front of this one in the
chain of interceptors.
This interceptor is greatly simplified and all it does is retrieve the instance from cache
Scheduling is implemented in new interceptor, all notify policies gone, simple
For the record, locking went from cache (early 2.0) -> this interceptor -> new interceptor