My app to recovers automatically from failures. I test it as follows:
- Start app
- In the middle of processing, kill the application server host (shutdown -r -f)
- On host reboot, application server restarts (as a windows service)
- Application restarts
- Application tries to process, but is blocked by incomplete 2-phase commit transaction in Oracle DB from previous session.
- Somewhere between 10 and 30 minutes later the DB resolves the prior txn and processing continues OK.
I need it to continue processing faster than this. My DBA advises that I should prefix my statement with
ALTER SESSION ADVISE COMMIT;
But he can't give me guarantees or details about the potential for data loss doing this.
Luckily the statement in question is simply updating a datetime
value to SYSDATE
every second or so, so if there was some data corruption it would last < 1 second before it was overwritten.
But, to my question. What exactly does the statement above do? How does Oracle resolve data synchronisation issues when it is used?