Sumit,

I am in the process of setting the same configuration up as well, but am much earlier in the process. I just downloaded the RESTlet API!

However, it sounds like the issues that you are having are between Spring and Hibernate. It sounds as though the transaction wrapping is not happening properly and the session is being closed prior to the elements that are being loaded lazily are accessed. You have to be sure that the lazy elements are accessed from a method that is being wrapped by the transaction manager and proxy.

Phil
[EMAIL PROTECTED]



On Nov 7, 2007, at 7:46 PM, Sumit Lohia wrote:


I'm using Spring, Hibernate, and Restlets and getting a bunch of
LazyInitializationExceptions. I've even implemented a OpenSessionInView filter
and that doesn't help either. Does anyone have a workaround for this?

I am using the Restlet framework (v1.0.1) with the embedded Jetty server as the HTTP Server connector. I'm trying to wire up my resources and DAOs using Spring. My DAOs use Hibernate for persistence. Furthermore, the Representation that I use only writes to the OutputStream when the write() method is called. The OpenSessionInView Filter that I created (similar to Spring's) is attached to the Component, but that doesn't help in dealing with the lazy retrieval because the write() method is not called until after the filter's afterHandle() has already
been called. Is anyone else facing this issue?

Thanks.

Sumit


Reply via email to