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. Feel free to contribute your findings to wiki btw :) 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 > http://wiki.apache.org/cocoon/CocoonAndHibernateTutorial > > 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 > whatsoever. > > Thanks, > Andre > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
