1 Reply Latest reply on Nov 2, 2009 7:27 AM by Marco Rossi

    Conversations and Transaction Rollbacks: conversation recovery?

    Matthias Age Newbie

      I'm using POJOs and long running conversations (flush-mode MANUAL) to create a wizard with more pages.

      If I'm on the last page of my wizard and try to flush the objects of the conversation, and there's a DB-error after my inserts and removes, seam will roll back the transaction. As a consequence of this the long running conversation will be in an inconsistent and unusable state (objects are detached and can't be updated any more etc. - see here http://www.seamframework.org/Community/HandlingATransactionRollback).

      I can't simply forward the user to a general error page like this:

      <exception class=org.hibernate.exception.ConstraintViolationException>
              <end-conversation before-redirect="false"/>
              <redirect view-id="/error.xhtml" />

      I have to stay on that page of the wizard and maintain the state (the complete information the user entered on all wizard-pages).

      How can I do this?
      There must be a solution to this problem, otherwise the whole SEAM-stuff (conversations etc) only complicates the programming-model without real use! It can happen rather often that a DB raises some Constraint violation Exceptions that I as programmer can't check (e.g. record is referenced from a lot of other tables)!