Re: Struts2 + JPA - Lazy Initialization During View Generation

2009-07-17 Thread Nathan Schulte
So is this the only resolution out there? To lazily initialize the contents I know I'll need before the container decides to trash the persistence context? There is no way to extend the context such that the lazy initialization will work when rendering the view?

Re: Struts2 + JPA - Lazy Initialization During View Generation

2009-07-17 Thread Jim Kiley
I think I missed the early part of the discussion -- I assume that the OpenEntityManagerInViewFilter is not the solution for you? jk On Fri, Jul 17, 2009 at 2:53 PM, Nathan Schulte nathan.schu...@ngc.comwrote: So is this the only resolution out there? To lazily initialize the contents I know

Re: Struts2 + JPA - Lazy Initialization During View Generation

2009-07-17 Thread Nathan Schulte
Jim Kiley jhkiley at summa-tech.com writes: I assume that the OpenEntityManagerInViewFilter is not the solution for you? I'm not using Spring. As such, I'm not familiar with this filter, but from the description, yes, that is what is needed. However, the app server manages the transactions,

Re: Struts2 + JPA - Lazy Initialization During View Generation

2009-07-17 Thread Wes Wannemacher
http://struts.apache.org/2.x/docs/non-ioc-version-of-opensessioninviewinterceptor.html This is not exactly what you want, and it's based on Hibernate and a hibernate session, but if you think of hibernate sessions as jpa EMs, then you can just make the appropriate changes to this and at least be

Re: Struts2 + JPA - Lazy Initialization During View Generation

2009-07-17 Thread Nathan Schulte
Wes Wannemacher wesw at wantii.com writes: This is not exactly what you want, and it's based on Hibernate and a hibernate session, but if you think of hibernate sessions as jpa EMs, then you can just make the appropriate changes to this and at least be further than you are now. Thanks Wes, I

Re: Struts2 + JPA - Lazy Initialization During View Generation

2009-07-17 Thread Nathan Schulte
Nathan Schulte nathan.schulte at ngc.com writes: I'll let you know what I come up with. Well, I was able to get this to work. The interceptor is placed on the end of the stack, although it's location oughtn't matter. Also, it is placed on the stack for _all_ actions. I'm not sure if this is a

Struts2 + JPA - Lazy Initialization During View Generation

2009-07-15 Thread Nathan Schulte
I'm currently using Struts2 in a project that is utilizing the Java Persistence API (JPA, specifically Hibernate) with container managed transactions (CMT). To access the Persistence layer, a layer was created using SLSBs as service objects which provide simple entity_type getentity_typeById( int

Re: Struts2 + JPA - Lazy Initialization During View Generation

2009-07-15 Thread David Canos
I use a Hibernate.initilize() call in the DAO layer for every object I need to see in the presentation layer (common jsp files).it avoids Lazy Initializations without passing Hibernate Proxy around layers. It works fine for me 2009/7/15 Nathan Schulte nathan.schu...@ngc.com I'm currently using

Re: Struts2 + JPA - Lazy Initialization During View Generation

2009-07-15 Thread Nathan Schulte
David Canos davidcanos at gmail.com writes: I use a Hibernate.initilize() call in the DAO layer for every object I need to see in the presentation layer (common jsp files).it avoids Lazy Initializations without passing Hibernate Proxy around layers. This was one of my last resort ideas. It