On 02.01.2007 23:05, Daniel Fagerstrom wrote:
One complication in our work in making the Cocoon components work in a standard Spring container without special Avalon support is that a large amount of our components are Poolable (or more specifically Recyclable). And Spring doesn't have any concept of object pooling.

Even worse Spring doesn't even have a concept of returning components to the container. For singletons the container can call a destroy method when the component goes out of scope. But for non singletons (prototypes) your are on your own and have to take care of destroying the component yourself. Of course it is possible to implement pooling for Spring anyway, but Spring doesn't help us.

Not that I want to propagate pooling, but Spring at least provides some support:
http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/aop/target/CommonsPoolTargetSource.html
http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/beans/factory/config/Scope.html

I don't know anything about the CommonsPoolTargetSource, but the Scope obviously provides a destruction callback mechanism. You only need to know the end of the scope, what's easy for request or session. Don't know what other scopes might apply.

I'd mostly refrain from pooling as well. But where we need it, we have still options.

Jörg

Reply via email to