No one? This seems like a major design flaw in Struts 2, if there is no way to use lazy loading in Struts 2 using JPA.
I've read something online that describes it may be possible to write a custom interceptor that can scan for annotations and inject the persistence context into a struts action. But without framework support for JPA (built in), how can Struts 2 ever be taken seriously? Isn't EJB3 and JPA the current standard spec? I'm not at all interested in using Spring either. And quite fankly I shouldn't be forced to use Spring purely for the Open Session in View pattern. Thoughts? On 6/1/07, Caine Lai <[EMAIL PROTECTED]> wrote:
I'm using EJB3 stateless session beans/JPA/JTA to manage my data access. But I can't figure out how one would use lazy loading in this scenario since any transaction opened in the EJB layer will already be committed prior to rendering the view. Any tips? I'm familiar with "Open Session in View" when using hibernate, but it's not quite the same when I'm using container managed transactions and dependency injection in EJB3. Or is it? Would I still open a hibernate session within the view and close it after the view is rendered in this scenario? Thanks for any pointers.