December 11, 2008 at 3:46 pm
As part of an ORM I have a VB.net transaction in which I call several CRUD stored procedures. Each procedure returns the RowVersion of the row inserted/updated. The problem is that when I commit the transaction the RowVersions of the rows in the transaction all suddenly change from the ones returned from the stored procedures.
Is this the expected behavior?
Can I set something (e.g. transaction isolation level) so that the first allocated RowVersion is the one that persists?
December 12, 2008 at 4:28 am
Don't use transactions on the read statement. There's no need for them anyway.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
December 12, 2008 at 7:03 am
Thanks for the reply.
The transaction is necessary. A possible sequence of calls is
Begin Tran
Call UpdateAccountTransferFrom and return rowversion
Call UpdateAccountTransferTo and return rowversion
...
End Tran
RowVersions now obsolete.
I use UpdateAccountTransferFrom/To for illustration. In practice the contents of the transaction are determined dynamically and vary with each transaction. However, each stored procedure either inserts, updates or deletes a single table row for some table.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply