Hi Danilo,

Danilo Tommasina wrote:
However calling the ObjectPool#close() from the realseAllInstaces() may be dangerous since after calling the ObjectPool#close() will no longer be usable and break future accesses to the PersistenceBroker.

The pool instance itself will no longer be usable, but on a future
access to the PB it force the ConnectionFactory implementation to create a new ObjectPool.

Personally I would leave the realeaseAllInstances() as it is and add a new shutdown() method that will call the releaseAllInstances() and then call the ObjectPool#close(). This way you will not break compatibility, since OJB will be still usable after calling the realeaseAllInstaces() as it currently is, while calling the shutdown() method will destroy OJB and if somebody tries to access it again after such a call, then well, expect a KA-BOOOOOOOM!!!


As said above, think this will not happen (only in comic books ;-)).

I have a question related to your PersistenceBrokerThreadMapping-patch.
Why is it not sufficient to nullify the ThreadLocal field only on
shutdown (you trace all created maps using a HashSet)? Doesn't it free the allocated memory? I ask this because OJB use ThreadLocal in other classes too (as mentioned by Bob in MetadataManager). On shutdown I simply nullify these fields.

regards,
Armin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to