Mar 19th, 2010, 05:21 PM
RichFaces tab + commit + detached object
We are using SWF 2.0.8, RichFaces 3.3.2, Hibernate implementation (version 3.3.0) of JPA.
We have a flow (called A) and a sub-flow (called B). In B, we have a view-state to display a screen with RichFaces tabs. We haven't found a way to switch flow state when a tab is selected, here is a thread about changing state situation: http://forum.springsource.org/showthread.php?t=57137
What we want is to commit the activity at each tab but to remain in B. We don't want users to work on the tabs which have seperate submit buttons then go back to the main screen to press Save button after everything is done. If we go to the end state in B to commit the transaction, we will return to A. Therefore we create a sub-flow of B for each tab, just to commit the transactions in that tab. It works fine with saving transactions, but when we used that approach for removing transactions, we got an error message "Removing a detached instance".
We have <persistence-context/> in both A, B and each sub-flow of B
Could anyone help us with what we should do?
Mar 23rd, 2010, 04:06 PM
Never mind, we found that we should commit the transactions in the service layer instead of creating a sub flow just to commit the transaction.