JD Daniels wrote:
I didn't see the need for a cocoon component. I looked again, but still can't find the article that got me going... basically here is my setup:
I use cocoon component put method, that gets JDBC connection from cocoon pool.
My flow looks like described in article :
function openSession()
{
var factory = cocoon.getComponent(Packages.bmnet.p3.cocoon.HibernateFactory.ROLE);
var hs = factory.createSession();
if (hs == null) { throw new Packages.org.apache.cocoon.ProcessingException("Hibernate session is null "); }
cocoon.releaseComponent(factory); cocoon.session.setAttribute("DisposeHibernateSession",hs);
return hs;
}
function closeSession(hs)
{
hs.flush();
hs.connection().close();
hs.close();
}
And typical function called by sitemap looks like this :
function show(id)
{
var hs = openSession();
var k = new Packages.bmnet.p3.beans.WiadomoscKandydata();
hs.load(k, new java.lang.Integer(id));
cocoon.sendPage("jx/wiadomosci", {"wiadomosci": k});
}And the servlet filter guarantee me that the session will be closed when I call cocoon.sendPage().
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
