AFAIK, SQL Anywhere does not really support nested transactions. Even when using BEGIN TRANSACTION/COMMIT TRANSACTION for T-SQL compatibility, this should behave like "nested savepoints". Given that, I would think there is only one real "commit", and until that, the lock will be hold.
Breck has written en detail on that in his great book and has cited it here, too (and I'm free to take a quote from that, too:):
The term "nested transaction" is sometimes used when @@TRANCOUNT rises to 2 or higher. That term is misleading, however, because only the outermost transaction has any meaning as far as database changes and locks are concerned. When @@TRANCOUNT rises to 2 or higher, a COMMIT statement does absolutely nothing except lower the @@TRANCOUNT value. A nested transaction implies that changes made in an inner transaction may be made permanent while changes made in the outer transaction are rolled back, and that simply is not possible in SQL Anywhere; there is no such thing as a nested transaction.
answered
17 Mar '15, 05:40
Volker Barth
39.9k●360●547●816
accept rate:
34%