With Oracle is it possible to (with a single database connection):
- lock a single row (row1)
- then lock another row (row2)
- release the lock on row1 (retaining the lock on row2)
- obtain a lock on another row (row3)
- release the lock on row2 (retaining the lock on row3)
- release the lock on row3
I realize Oracle supports many different kinds of locks (I've found this very helpful: http://broadh2o.net/docs/database/oracle/oracleLocks.html ), so perhaps the answer depends on which kind of locks are chosen. I'm interested in exclusive locks - i.e. locks which prevent other connections from updating the row.
I would like to know if I can perform operations 1-6 using a single database connection. I certainly could use a separate database connection for each row. It seems that locks are released using COMMIT/ROLLBACK, so that would suggest releasing the lock on a single row isn't possible.