Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Closing a task flow with transactions, but no changes

Tony De BuysMar 11 2015 — edited Mar 11 2015

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

Comments

Timo Hahn

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

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

1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 8 2015
Added on Mar 11 2015
2 comments
563 views