I have a problem when I try to submit my form for the second time using a4j:commandButton
My view is:
<h:form id="myform">
<a4j:region renderRegionOnly="true">
<h:panelGroup>
<h:inputText size="4" maxlength="2"
id="input1"
value="#{departementController.departement.name}">
</h:inputText>
<h:inputText size="4" maxlength="2"
id="input1"
value="#{departementController.departement.subdepartement.name}">
</h:inputText>
</h:panelGroup>
</a4j:region>
<h:panelGrid columns="1">
<a4j:commandButton
value="save"
action="#{departementController.validateDepartement}"/>
</h:panelGrid>
</h:form>
When I hit save for the first time, everything goes ok, and changes are saved. But when I hit save for the second time, i get this:
org.hibernate.LazyInitializationException: could not initialize proxy - no Session
I checked, validateDepartement() method isn't called at all the second time, I just get this exception, and save fails. Just to say that I'm handling lazy loading in views by using Open Session in View (Transaction in View).
Thanks in advance,
Stefan