My Oracle Support Banner

DBTransaction.setClearCacheOnRollback(false) Doesn't Seem To Work (Doc ID 2507796.1)

Last updated on SEPTEMBER 15, 2022

Applies to:

Oracle JDeveloper - Version and later
Information in this document applies to any platform.


While developing an ADF web application, a DB function needs to be called to check the data through some business rules before committing the data.
If the data passes the business rules, the application will commit the data. If the data does not pass business rules, the application allows the user to modify the data on the form, post changes,
and call the DB function to run the business rules again. Basically, the application is doing the following:

  1. Post data changes to the DB by calling DBTransaction.postChanges()
  2. Call a DB function to run business rules on the posted data. The function will return "Success" or an error string.
  3. If the DB function returned Success, commit the data. Or, if data didn't pass business rules, allow the user to edit the data and repeat from step 1.

In the case where the posted data doesn't pass the business rules (Data A), and the data is corrected on the web form and posted again (Data B),
the DB doesn't seem to have the second version of data and the business rules are run again with the original data that was committed in the DB (Data C).
It appears as if there was a rollback on the DB side but not on the web form side.

To avoid loss of data on the web form while executing rollback on data posted to the database, we call DBTransaction.setClearCacheOnRollback(false)
when the app module session is initialized. the ApplicationModuleImpl.prepareSession(Session) method is overriden:

This however doesn't seem to have any effect as the data entered on the web form is also rolled back and is lost. How to get DBTransaction.setClearCacheonRollback(boolean) to work in order to avoid losing user-entered data when rolling back a transaction?


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.