commit after select
Solution 1
there are only a few situations that I can think of that you may want to commit after a select.
if your select is joining on database links, a transaction will be created. if you attempt to close this link, you'd get an error unless you committed/rolled back the transaction.
select for update (as DCookie says) to release the locks.
to remove an serialized isolation level if set or to add one, if you've been selecting from db links prior to invoking this.
Solution 2
If you did a SELECT ... FOR UPDATE;
you would need a COMMIT or ROLLBACK to release the records held for update. Otherwise, I can't think of any reason to do this.
Related videos on Youtube
Alex
Updated on June 04, 2022Comments
-
Alex about 2 years
I have read the explanations when a
commit
may be neccessary after aselect
statement for DB2 and MySQL:Is a commit needed on a select query in DB2?
Should I commit after a single select
My question is when and why would it be important to
commit
after executing aselect
statement using Oracle?