0

Well, i'm trying to creating the Pattern "OpenView Session in View" manually, without Spring Framework.

My ideia is open the EntityManager SESSION in Restore View Phase and closes in Render Response Phase, using a Listener:

<phase-listener>br.com.cardoso.bean.LifeCycleListener</phase-listener>

But if the process came from a CRONTAB and the JSF phases is not triggered i think that this is won't work .

Someone have a good solution to implement OpenSessionInView without Spring ? (I'm using CDI)

Ronaldo Lanhellas
  • 2,134
  • 4
  • 27
  • 58
  • I will skip the current question in its entirely. First of all, both `org.springframework.orm.hibernateX.support.OpenSessionInViewFilter` and `org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter` are Spring specific and thus, framework dependent. Both of them are not good things to use for lazy relationships. Just keep on using things like *join fetch* whenever required. – Tiny Oct 24 '15 at 03:12
  • Food for read: http://stackoverflow.com/a/32006660 – BalusC Oct 24 '15 at 10:55
  • Thanks balusC. I understand that i should fetch exactly what i need. – Ronaldo Lanhellas Oct 24 '15 at 13:43

0 Answers0