4 Replies Latest reply on May 1, 2007 12:10 PM by Keith Naas

    two transactions, one entityManager

    Keith Naas Newbie

      We have an application where every 5 minutes an a4j:poll queries to see if there are any user alerts to display. If there is an alert, the user is presented with a modal dialog. They then click an OK button on the dialog which causes the Alert to save to the database with the acknowledgment time.

      This alert dialog can be displayed on any screen in the application, but the alert acknowledgment action should not participate in those screen's transactions.

      It works great in every scenario except for the following: The user is on an edit screen and is making changes. A new alert modal dialog is displayed and the user clicks OK. The alert acknowledgment time is saved, but so are the user's changes on the edit screen. This is not good.

      The alert action is a Stateful EJB.

      I have tried numerous ways to get this to occur how I want using @TransactionAttribute.NOT_SUPPORTED, REQUIRES_NEW, but I just cannot get it to work.

      When the form posts and the acknowledge alert action is called, is it possible that the form values for the edit screen are also being applied to this new "nested" transaction or is the transaction demarcation not really occurring like I think it is?