I m using JSF 2.0 with Spring 3.2.8 and JPA 2.0 and hibernate 4.2.11.Final, and i have an issue, i'm struggling more than 2 days now to undestand this problem but i have no explanation for it
actually the flow consist of viewing a list of employees with a Primefaces datatable and then selecting a specific row to set it in the JSF ManagedBean .
The case works perfectly when the JSF Managed Bean scope is set to SessionScoped
But when i change the scope to ViewScoped , the list is loaded with no problem but when i select a row the ajax request returns an error and here is the XML response :
when i debuggued the hibernate class that is throwing the exception , EntityManagerFactoryRegistry.getNamedEntityManager Factory it finds 2 already registred EntityManagerFactory . i dont understand who did register them and when and why the case does only occur when using ViewScoped JSF Beans (i'm not using CDI anywhere)
here is my managed bean
I'm using extended EntityManager because i have Lazy relationsShip in my model , so i'm calling close method on the persistent context at the end of my flow.
Any one have idea what's the matter with the ViewScoped within Spring or may be it has nothing to do ( i m saying so because it just work fine with SessionScoped but i don't won't to have My Beans as Session Objects)
Thank's for your Help.