Hey Marc,
> Simone,
>
> can you justify in detail why the mutex for the locking? it
> doubles the lookup times...
Take Stateful Instance Int'r. You can't do
EnterpriseContext ctx = container.getInstanceCache.get(id);
synchronized (ctx) {...}
since the ctx can be passivated between the 2 rows.
It can be passivated because isLocked is false and the TX may not be set.
Given this, I also used it for entity, but your previous solution (sync'ing
the cache object) seems OK, even faster (but I don't feel comfortable - I
don't know why anyway... :-)
If I throw apart my feelings, I'd say we can use the cache also for stateful
and hence remove totally the mutex.
I'll think some more on this, I will post doubts (if I'll have any).
Regards,
Simon