On Monday 23 October 2006 10:52, Josh Helmer wrote: > I know this has been discussed before, but I am still having a few issues > with it here. I am doing work on an app where we use Hibernate for the > persistence layer. We have a couple of client apps that use EJB's.
Um... too vague... let me clarify a little. We use remote stateless session beans. The client sends a request and we use hibernate to load the relevant data and then return it to the client. > The > issue that I am having is that with Hibernate if I have a lazy-loaded > collection Hessian bombs out horribly (It internally catches the > LazyInitializationException but then it writes the fault out to the stream. > The client parser errors out because it does not expect to see a fault in > the middle of the stream. Same problem occurs with Burlap.) > > >From the archives it looks like there are a couple of suggestions: 1. > > readResolve()/writeReplace() code. 2. do not include the hibernate jars in > the client or set the sendCollectionType option (seems you must still fully > initialize all collections though which is a problem for me) 3. Implement > a custom SerializerFactory. > > For my purposes, it looks like option 3 is the best one for me. The > collections that are lazy-loaded will not be accessed outside a session and > if any attempts are made to access the data in the session I just want to > throw an Exception. Seems easy enough... Unfortunately, I am having > problems determining exactly how to actually set it up. From what I read, > I should be able to implement an AbstractSerializerFactory and then > register that with hessian. Unfortunately, when using the EJBServlet the > QSerializerFactory is hardcoded into the HibernateWriter and is not > accessible Am I just overlooking something? > > Thanks, > Josh > > _______________________________________________ > resin-interest mailing list > resin-interest@caucho.com > http://maillist.caucho.com/mailman/listinfo/resin-interest _______________________________________________ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest