Thursday, February 16, 2012

Commit & Rollback Logic in VB.NET

I have several sets of code that need to delete rows from more than one database at a time. The rows are basically linked without being identified as having a foreign key. This means I issue two deletes. If one fails, especially the second one, there is no way to roll the first delete back.

Can someone either point me to some code that enables me to link the deletions, allowing me to insure that both are successful or both do not occur.

I cannot identify any fields on the secondary database table as specifically linked to the primary, as the secondary database is a storage medium for images, that may be linked to more than one different table.

TIA for any opinions, options, etc. Tom

you need to wrap a transaction around your deletes

read this:http://msdn.microsoft.com/msdnmag/issues/06/11/DataPoints/default.aspx

|||

Many thanks. That looks like the ticket.

Tom

No comments:

Post a Comment