cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jorg Heymans ...@domek.be>
Subject Re: Avalon-Component and pooling
Date Tue, 03 Feb 2004 07:49:08 GMT
> 
> Another idea is to implement the interfaces Initializable and Recyclable 
> and creating in method initialize() the connection and returning it back 
> to the pool in recycle(). What do you think about that?
> 
> But there is one problem: What happens if an exception occures which was 
> not catched? Like a ParameterException or a NullPointer? How to return 
> the connection clear back to the pool?
It is my assumption that even if you get uncaught exceptions during the 
active lifetime of a component, cocoon still recycle()'s the component.

You can try this out by throwing a runtime exception in your setup() 
method and put a logging statement in recycle(). (ofcourse this is 
usually the point where someone says "yep done that and recycle is not 
called")

> 
> Is there a best practice way?
> 
> Thank you!
> 
> Regards
> Stephan


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message