I'm trying to build a webapp with the architecture similar to that example app in the Hibernate site (
Caveat Emptor, JPA/EJB3 version), I mean,
JSF for the view, controllers as
EJB Session Beans and a DAO layer also implemented as Stateless EJB.
In that application, I'm using container-managed entity manager, through dependency injection via annotations.
In addition, I have the following requirements/restrictions:
I cannot/do not want to use the Open Session in View pattern, or anything similar, like JSF phase listeners. I cannot aggregate any kind of framework that has built-in solution to that Lazy problem, like Spring or Seam, to my project. Only default JavaEE products/specifications. In some use cases of that webapp, I will have long running conversation, with several page requests inside a single business process, that should be commited only in the last page, moroless like wizards. All parent-child/one-to-many relationship MUST be mapped LAZY, I mean, FetchType.EAGER or queries using FETCH JOIN is NOT an option. So, considering all this things above, my question is:
What is the solution to avoid LazyInitializationException in such a scenario? If my question or situation is not clear, I can put some sample code here, or I can try to explain it better.
Sorry for my weird english.
I really appreciate any help.
Davi.