In the app I'm working on, MTS starts a transaction, then lots of objects do lots of things, and finally the transaction is committed.
There is a great risk of running into deadlocks that way, but at the moment an even worse problem is: users have to wait until locks set by other user(s) are released, this may take many seconds and result in time-outs.
The whole thing pivots around one single function that updates and reads a specific record.
This function needs to be in a transaction, as it is absolutely necessary that no two users update the same values. However, after reading the result, the transaction can be closed, as no roll-back is ever required. Locks set by a nested transaction however are only released when all of the transaction is committed.
Is there a way to release locks within a nested transaction, and have the rest of the transaction committed as usual, at the end of the whole thing?
There is a great risk of running into deadlocks that way, but at the moment an even worse problem is: users have to wait until locks set by other user(s) are released, this may take many seconds and result in time-outs.
The whole thing pivots around one single function that updates and reads a specific record.
This function needs to be in a transaction, as it is absolutely necessary that no two users update the same values. However, after reading the result, the transaction can be closed, as no roll-back is ever required. Locks set by a nested transaction however are only released when all of the transaction is committed.
Is there a way to release locks within a nested transaction, and have the rest of the transaction committed as usual, at the end of the whole thing?