adaptor.StartTransaction

Posts   
 
    
he00273
User
Posts: 133
Joined: 02-Oct-2008
# Posted on: 29-Jan-2009 08:31:23   

Why is there a string value required in starting a transaction

public virtual void StartTransaction( IsolationLevel isolationLevelToUse, string name )

What is this "name" value used for? There is no explaination as to why its there. I am guessing it might be used for Transaction SavePoints. However I do not like guessing so if you could explain its use it would be appreciated.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 29-Jan-2009 10:49:16   

Starting v.2.6 the name is there for backward compatability for SQL Server. ref: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=14411

Previously it was used to identify a specific transaction in logs (eg. logs created by SQL Profiler).

he00273
User
Posts: 133
Joined: 02-Oct-2008
# Posted on: 30-Jan-2009 00:44:46   

Walaa wrote:

Starting v.2.6 the name is there for backward compatability for SQL Server. ref: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=14411

Previously it was used to identify a specific transaction in logs (eg. logs created by SQL Profiler).

You could update your documentation to say that from version 2.6 its use has been deprecated but is retained for backward compatibility purposes. I know maintaining documentation is a pain but I think it important to update it from information contained in the forums.

I noticed that it appears to be used when using savepoints. Is this actally important here or does a rollback simply rollback to the previous adaptor.SaveTransaction and the name here is more for documentation purposes. In otherwords if you use several adaptor.SaveTransactions with different names, will a rollback, rollback to the adaptor.SaveTransaction with the same name or just the most recent?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 30-Jan-2009 02:43:47   

he00273 wrote:

Walaa wrote:

Starting v.2.6 the name is there for backward compatability for SQL Server. ref: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=14411

Previously it was used to identify a specific transaction in logs (eg. logs created by SQL Profiler).

You could update your documentation to say that from version 2.6 its use has been deprecated but is retained for backward compatibility purposes. I know maintaining documentation is a pain but I think it important to update it from information contained in the forums.

We will look into it.

he00273 wrote:

I noticed that it appears to be used when using savepoints. Is this actally important here or does a rollback simply rollback to the previous adaptor.SaveTransaction and the name here is more for documentation purposes. In otherwords if you use several adaptor.SaveTransactions with different names, will a rollback, rollback to the adaptor.SaveTransaction with the same name or just the most recent?

The adapter.Rollback("SavepointX"); will rollback to the adapter.SaveTransaction("SavepointX");. adapter.Rollback("SavepointZ"); will rollback to the adapter.SaveTransaction("SavepointZ");. And so on...

David Elizondo | LLBLGen Support Team