Surely this should be the same as a termination of a session and cause a rollback? It seems to me to be the most un-Oracle thing possible. I was actually shocked when I found out that it did this
More importantly - would anyone object if Oracle changed it to rollback on exit?
Oracle by default does not automatically commit a transaction (Autocommit is typically off). Transaction Management (Commit or Rollback) is left to the client as this askTom post explains nicely. The tool you use may provide this option for you. For e.g., SQL*Plus commits any open transaction upon exit.
Turn off the auto commit option in SqlDeveloper. Go to Tools -> Preferences -> Database -> ObjectViewer Parameters and uncheck the box Set Auto Commit On.
You can specify integer to assign the transaction a system change number if you do not wish to commit the transaction using the current system change number. FORCE CORRUPT_XID 'string' - allows you to commit a corrupt or in doubt transaction by specifying the transaction ID in single quotes as string.
Solution 1. 1) If it is a windows SQL*PLus, click on File/Cancel. 2) Press Cntrl + C which will also stop the execution.
Funnily enough, with the 11gR2 release this week (2009-09-03), SQL*Plus now has an option to COMMIT or ROLLBACK on EXIT. Doc here
I'd guess in the next few weeks/months, there'll be an 11gR2 Instant Client which you can use against your current database and get your desired behaviour
A caution to be aware of. If you DISCONNECT or CONNECT to a different session, it will still implicitly commit the transaction (according to the doc).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With