|
I'm not sure if this is what you mean or if will solve your problem, but
have you tried retaining the database object using JNDI instead of the
session context ?
I have created an initialisation servlet that stores a JDO object in the JNDI context as follows: (You will need to obtain "jndi.jar" , "rmiregistry.jar", and "providerutil.jar" from the Sun website). import javax.naming.*;
String contextFactory = "com.sun.jndi.rmi.registry.RegistryContextFactory";
// create the JNDI Context
//retreive the database from JNDI as a test
Hope this helps. Graeme
"Roberto M. Camps" wrote: I've made a JSP application with castor. I have a design problem, I don't know what to do when I have a session object (which will be instantiated in one JSP page and stay in memory on another JSP pages throught the http servlet Session object) and that object has one or more lazy loading collection attribute/s.If I commit and close the database castor object at the first JSP, then on the other JSPs there will be an error when I try to get a lazy loading attribute. So I guess I will need to retain the same database castor object for all the JSPs pages until the object with lazy loading attributes is no longer needed (or the session expires).What do you think about the best solution for that? Thanks. Robert. |
- Re: [castor-dev] JSP & Castor with session beans and ... Graeme Jackson
- Re: [castor-dev] JSP & Castor with session beans... Roberto M. Camps
