cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Juffer <>
Subject Re: pooling + hibernate
Date Mon, 31 Oct 2005 20:48:15 GMT
Hi Johannes,

thanks for your reply.

 > Johannes Textor wrote:
> Hi  Andre,
> even though it _is_ possible to persist objects from within layers that
> don't know anything about cocoon by propagating the connection pool in
> an InheritableThreadLocal, there is basically no reason why you
> shouldn't use an external C3P0 pool, and move all persistence related
> logic out of cocoon's sight (it is even cleaner design I think).
> You could then modify the OpenSessionInViewFilter to open a hibernate
> session directly upon instantiation and would not need the additional
> avalon component used in wiki.

Well, I need to do some reading now to understand a few things ...

On the other hand, as you already pointed out, disconnecting the 
persistence logic from cocoon is a lot cleaner and definitely a better 
design and also makes it easier to test outside cocoon. I think I will 
go for that solution.

> Feel free to contribute your findings to wiki btw :)

I'll keep that in mind.


> Regards,
> Johannes
> Andre Juffer schrieb:
>>Hi all,
>>I am looking into the option to rely on an alternative pooling system
>>for hibernate that the one provided by cocoon. I have employed (with
>>success) the implementation as outlined in
>>However, this implementation results in a tight dependence upon
>>cocoon, such that it appears to be a lot more difficult (if not
>>impossible) in cocoon based web applications to persists objects from
>>within layers that don't know anything about cocoon. At least, I
>>cannot entirely see right know how exactly that would work as of yet.
>>Would there be any reason to assume that it is -not- a good idea to
>>use two different pooling systems next to each other (cocoon and e.g.
>>C3P0). Using a pooling mechanism other than that of cocoon seems to
>>make it a lot easier to get to a org.hibernate.Session instance (e.g.
>>with HibernateUtil, as documented on the Hibernate website, which
>>effectively  employs the getCurrentSession() provided by
>>org.hibernate.SessionFactory) virtually anywhere where access to the
>>persistence layer is required.
>>Are there be issues related to the servlet filter for disposing
>>Hibernate sessions (see the wiki). For the time being, I just want to
>>use cocoon and hibernate and not an additional framework like swing or
>>To unsubscribe, e-mail:
>>For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Andre H. Juffer              | Phone: +358-8-553 1161
The Biocenter and            | Fax: +358-8-553-1141
     the Dep. of Biochemistry | Email:
University of Oulu, Finland  | WWW:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message