Have a look at the ReferenceQueue object : <quote> A java.lang.ref.ReferenceQueue is a simple data structure onto which the garbage collector places reference objects when the reference field is cleared (set to null). You would use a reference queue to find out when an object becomes softly, weakly, or phantomly reachable so your program can take some action based on that knowledge.
For example, a program might perform some post-finalization cleanup processing that requires an object to be unreachable (such as the deallocation of resources outside the Java heap) upon learning that an object has become phantomly reachable. </quote> http://developer.java.sun.com/developer/technicalArticles/ALT/RefObj/ I'm trying to figure out a fix for a deadlock scenario with the cache, passivation, and the OveragerTask. I was thinking. Why do all this work to see if a ctx can be passivated? It is just error prone. Couldn't we just let the garbage collector decide when to passivate? Implement EnterpriseContext.finalize to 1. passivate the ctx 2. put the object in the pool. The javadocs for finalize state that it is ok for the finalize method to do stuff like "making this object available again to other threads". So why all the hassle? What are the drawbacks of this? I can't see any right now. Thanks, Bill XXXXXXXXXXXXXXXX Bill Burke Chief Architect JBoss Group, LLC XXXXXXXXXXXXXXXX ------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 _______________________________________________ JBoss-Development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
