Nicolas Bielza wrote:

Hi,

I ran into a small problem when using hibernate inside a flowscript and
a velocity template to generate the XML from the "hibernated" objects.
Here's what I'm doing:

1. Get a hibernate session and retrieve some objects from the DB.
2. Pass these objects to a velocity generator to create some XML (I'm
calling cocoon.sendPage()).
3. Close the hibernate session.

Now, when I serialize the velocity output to XML, there's no problem; if
I add a XSL transform step and serialize to HTML, I get lazy
initialization exceptions.
Have you tried this?:

function someView() {
    var session = obtainSession();
    var data = dao.getData( session );
    cocoon.sendPage( "view/someView.jx",
                     { data: data },
                     function() { session.close(); } );
}

see
http://cocoon.apache.org/2.1/userdocs/flow/api.html#Cocoon+Object

--
Leszek Gawron                                      [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to