Use of ROLLBACK
Posted in 2000
We have an application development group that has put together an
application that primarily queries a database. While many read I/O's take
place (no attempt has been made to optimize queries) the development group
claims that they are not updating so I'll assume most of the writes could be
attributed to things like hash joins, sorting, or grouping. The database is
logged, unbuffered.
Here's the question. For some reason, they coded the application to issue a
ROLLBACK at the conclusion of a transaction. For example:
Begin work;
Select..
Select.
Select.
Rollback;
This is not used because they wish to "change their mind" - a standard
inquiry uses ROLLBACK. Where they actually want to save any data, they
obviously use a commit.
Off the top of my head I can't think that this is a very efficient way of
releasing held locks. They claim it shouldn't make any difference because
they didn't modify anything. Yet, like a mentioned above, I see 'write' I/O
's when I "onstat -u". An "onstat -p" doesn't show many rollbacks (relative
to the
Thoughts.comments.suggestions.