1 Reply Latest reply on Feb 16, 2011 3:29 PM by Miles Loring

    Transactions and Redirect

    Miles Loring Newbie

      I am running into an issue with conversations, persistence and redirecting.


      I am using the latest version seam-faces and seam-persistence.


      I have narrowed it down to this situation. I have a conversation scoped 'service' bean that updates an entity using a seam managed PC. I also have two conversation scoped controllers that back two .xhtml pages. Both of these controllers inject this service. If I start on one page and invoke this service (with a button) the entity gets updated fine.


      There is a link on this page that redirects(via faces-config) to the second page. The conversation is working as the same values for service(and other things) are being injected in the second controller. When I try and call the same method from second page, any writes to the database through the entity manager do nothing. No error message, nothing. I can read from the DB after this redirect but not write. If you go to the second page right away and begin a new conversation the service works fine as well. Seems to only fail after the redirect.


      It seems like I do not have a transaction. My service is annotation with @TransactionAttribute and is injecting a SMPC.


      Any help would be great.

        • 1. Re: Transactions and Redirect
          Miles Loring Newbie

          I took out seam-faces and it solved my issue. The only thing we were using it for was the @ViewScoped so it was not a huge issue.


          It seems like seam-faces was hijacking my defined transaction management from seam-persistence. Is there a way to turn off the seam managed transactions from the faces module? I would assume that there will be many people looking to seek benefits from both modules.