9 Replies Latest reply on May 23, 2011 4:55 PM by 611314

    "Rollback" changes from a single View Object

      Hello all,

      In a form there are two tabs. In each of this tabs input fields from two view objects.

      I need for each of this tabs a reset button, which should restore (separatelly) the view object to original state.
      A rollback operation is not possible, since both view objects will be restored and is required only one to be restored.

      I've try with following code:
      but is not working, since there are some changes that are made in view object directlly.

      My question: Is it possible to restore (rollback) a single view object? If yes, please let me know how.

      Thank you,
        • 1. Re: "Rollback" changes from a single View Object
          Declaratively try binding and executing an iteratorExecute action on the VO iterator.
          • 2. Re: "Rollback" changes from a single View Object
            Hi Nick,

            Your solution is not working. The behaivour is similar with invoking method executeQuery().

            Some more clarifications might be useful:

            What I have is similar with master-detail scenario:
            In first tab there are some master object properties from a view object
            and in the second tab associated items; this items can be deleted/inserted or modified ( this mean view object operations liek createRow(), row.remove() etc.)

            So what I need is a reset only for detail items view object without reseting the edited values from master view object?


            Edited by: Bogdan on Sep 16, 2010 2:58 PM
            • 3. Re: "Rollback" changes from a single View Object
              John Stegeman

              You could try a couple of approaches:

              1). Expose an AM method that does:
              getDBTransaction().clearEntityCache("<entity on which the detail rows are based>"); // repeat if more than 1 updatable entity
              <execute the detail VO again>
              2). Loop through each row in the detail VO and call refresh(<forget changes>) on the underlying entity(s)

              • 4. Re: "Rollback" changes from a single View Object
                Hi John,

                Thank you for your suggestions.

                For the first one i've got the following exception:
                <RegistrationConfigurator><handleError> Server Exception during PPR, #1
                javax.servlet.ServletException: *JBO-25303*: Cannot clear entity cache com.xyz.portal.model.eo.User2UserGroup because it has modified rows
                Caused by: oracle.jbo.InvalidOperException: JBO-25303: Leeren des Entity-Cache com.xyz.portal.model.eo.User2UserGroup nicht möglich, weil geänderte Zeilen vorhanden sind
                     at oracle.jbo.server.DBTransactionImpl.clearECacheWithCheck(DBTransactionImpl.java:3962)
                     at oracle.jbo.server.DBTransactionImpl.clearEntityCache(DBTransactionImpl.java:4027)
                Details about this error:

                "JBO-25303: InvalidOperException

                Cause: A dirty entity cache cannot be cleared. The client asked to clear an entity cache but some rows in the entity cache have been modified. An entity cache with modified rows cannot be cleared.

                Action: Do not attempt to clear an entity cache with modified rows in it."

                Is it something that i need to do before clearing the EO cache?

                Here is the code:
                        final ViewObjectImpl selVO = ...
                        ApplicationModuleImpl appModule = (ApplicationModuleImpl)selVO.getApplicationModule();
                The second option, i think it will not work for deleted rows; maybe the delete should be done with removeAndRetain.

                • 5. Re: "Rollback" changes from a single View Object

                  I addition to pursuing what was suggested above, try the following:
                  // empty the RowSet
                  // re-populate the RowSet based on the underlying VO query
                  • 6. Re: "Rollback" changes from a single View Object
                    Raj Gopal K
                    Hi Bogdan,

                    did u got the solutions for this problem

                    can you please reply with an solution

                    RajGopal K
                    • 8. Re: "Rollback" changes from a single View Object
                      Frank Nimphius-Oracle

                      you can set transaction safe points when entering the tab and then just undo what you changed in the tab. See page 6 "Explicit ADFm Savepoints in ADF Task Flow" in


                      • 9. Re: "Rollback" changes from a single View Object
                        I was able to refresh my dirty records using "voRow.refresh(REFRESH_WITH_DB_FORGET_CHANGES)" for the header and for each of the detail records.