Forum Stats

  • 3,827,815 Users
  • 2,260,823 Discussions
  • 7,897,383 Comments

Discussions

Closing a task flow with transactions, but no changes

Tony De Buys
Tony De Buys Member Posts: 4
edited Mar 11, 2015 10:50AM in JDeveloper and ADF

Hi there

When using bounded task flow that use shared transactions I would like to know what is best practice when closing the task flow if no changes need to be persisted to the database.

We would like to have three buttons on our pages/fragments: Save, Cancel, Close.  The Save button flows to a TaskFlowReturn which has an End Transaction set as commit.  The Cancel button has an End Transaction set to rollback. 

We intend the Close button to simply return to the calling flow, without calling a commit or rollback.

We can enable/disable the buttons depending on the "dirty" state.

We cannot, however, put a TaskFlowReturn on the flow without setting the End Transaction setting.

My question is: would setting a rollback End Transaction on the close button result in an unnecessary call to the database?

How should this be implemented should we want the Save, Cancel and Close buttons?

Thanks in advance

Answers

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,462 Red Diamond
    edited Mar 11, 2015 8:41AM

    You should use commit. The commit is only executed in the task flow which holds the transaction which is the parent task flow. If a sub task flow commits nothing happens and the changes are be committed when the parent commits.  If nothing has changes nothing happens.

    If you use a rollback the parent has to rollback his changes too, which is not what you want to do.

    Timo

  • Zlatko Sirotic
    Zlatko Sirotic Member Posts: 2,134 Gold Trophy
    edited Mar 11, 2015 10:50AM

    When using bounded task flow that use shared transactions ...

    Which settings has your taskflow, perhaps:

    Shared Data Control Scope + Use Existing Transaction if possible ?

    Regards,

    Zlatko

This discussion has been closed.