From: Scott M S. <sco...@at...> - 2003-03-06 03:13:29
|
In EntityInstanceCache.canPassivate(EnterpriseContext ctx) there is the following statement: else if (m_container.getLockManager().canPassivate(((EntityEnterpriseContext)ctx).getCacheKey())) { return false; } The corresponding BeanLockManager.canPassivate(Object) code is: public synchronized boolean canPassivate(Object id) { if (id == null) throw new IllegalArgumentException("Attempt to passivate with a null object"); BeanLock lock = (BeanLock)map.get(id); if (lock == null) throw new IllegalStateException("Attempt to passivate without a lock"); return (lock.getRefs() > 1); } This seems like a strange reversal of the 'can passisvate x' assertion. I would expect that this is true if there are no lock references. The usage from the EntityInstanceCache.canPassivate seems consistent with this reversed semantic but it is confusing. If the BeanLockManager.canPassivate call is true then EntityInstanceCache.canPassivate is false and visa-versa. Please clarify this so myself and others don't get a headache looking at this code. xxxxxxxxxxxxxxxxxxxxxxxx Scott Stark Chief Technology Officer JBoss Group, LLC xxxxxxxxxxxxxxxxxxxxxxxx |