I have to use Seam's user transaction for one of my stateful bean. I needed user managed transactions because I was doing batch processing. I was using Bean Managed Transactions.
On the view, there are two major process; one is a command button which calls a method and the other one is a <rich:dataTable> which has one entity per line, and h:selectOneBooleanCheckBox for each entity attributes. The idea is that I'm providing user with a list of books, and users can select if a book is Spanish, Chinese or Italian by selecting the appropriate check boxes. Since I'm using ajax, I put <a4j:support> inside <h:selectOneBooleanCheckBox>, which is supposed to automatically update the value in the database. But it didn't happen. The boolean value never gets updated.
After trying a few hours, I finally took out the transactionManagement annotation from the bean and made it a regular stateful bean. Then all those boolean values get updated. I think since my stateful bean is responsible for committing transactions, that's why I can't expect the container to automatically commit the boolean values in the entities.
No comments:
Post a Comment