Click or drag to resize

TransactionBase Class

Abstract transaction class which is used to control a serie of actions on multiple entities or entity collection classes. The database connection is opened in the constructor, so the transaction instance is ready to use. This class is the non-COM+ version, it will always start a new ADO.NET transaction and will not be using a COM+ transaction when callers are participating in such a transaction.
Inheritance Hierarchy
SystemObject
  SD.LLBLGen.Pro.ORMSupportClassesTransactionBase

Namespace:  SD.LLBLGen.Pro.ORMSupportClasses
Assembly:  SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.6.0.0 (5.6.19.0117)
Syntax
public abstract class TransactionBase : ITransaction, 
	ITransactionController, IDisposable

The TransactionBase type exposes the following members.

Constructors
  NameDescription
Protected methodTransactionBase(IsolationLevel, String)
CTor. Will read the connection string from an external source.
Protected methodTransactionBase(IsolationLevel, String, String)
CTor.
Top
Properties
  NameDescription
Public propertyConnectionString
Gets the connection string used for the connection with the database. Only settable with the constructor.
Public propertyConnectionToUse
The connection object to use with this transaction.
Public propertyEntitiesInTransaction
List of GUID's of the entities currently participating in this transaction. This collection is used to keep track of which entities already have been added during a recursive save.
Public propertyInSystemTransaction
Gets a value indicating whether a System.Transactions transaction is going on. If not, false is returned.
Public propertyName
Gets the name of the transaction. Only settable with the constructor.
Public propertyPhysicalTransaction
The physical transaction object used over ConnectionToUse.
Public propertyTransactionIsolationLevel
Gets the isolation level the transaction should use. Only settable with the constructor.
Top
Methods
  NameDescription
Public methodAdd
Adds the passed in object as a participant of this transaction.
Public methodAddAuditor
Adds the auditor passed in to the set of auditors to get audit entities from at commit.
Public methodCommit
Commits the transaction in action. It will end all database activity, since commiting a transaction is finalizing it. After calling Commit or Rollback, the ITransaction implementing class will reset itself. When used in combination of COM+, it will call ContextUtil.SetCommit() to commit the current COM+ transaction.
Protected methodCreateConnection
Creates a new DbConnection instance which will be used by all elements using this ITransaction instance. Reads connectionstring from .config file.
Protected methodCreateConnection(String)
Creates a new DbConnection instance which will be used by all elements using this ITransaction instance
Public methodDispose
Implements the IDispose' method Dispose.
Protected methodDispose(Boolean)
Implements the Dispose functionality.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnBeforeCommit
Called right before the physical transaction is committed.
Protected methodOnBeforeRollback
Called right before the physical transaction is rolled back.
Public methodRemove
Removes the passed in object from the transaction.
Public methodRollback
Rolls back the transaction in action. It will end all database activity, since commiting a transaction is finalizing it. After calling Commit or Rollback, the ITransaction implementing class will reset itself. When used in combination of COM+, it will call ContextUtil.SetAbort() to abort (rollback) the current COM+ transaction.
Public methodRollback(String)
Rolls back the transaction in action to the savepoint with the name savepointName. No internal objects are being reset when this method is called, so call this Rollback overload only to roll back to a savepoint. To roll back a complete transaction, call Rollback() without specifying a savepoint name. Create a savepoint by calling Save(savePointName)
Public methodSave
Creates a savepoint with the name savePointName in the current transaction. You can roll back to this savepoint using Rollback(String).
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Events
  NameDescription
Public eventTransactionCommitted
Raised when Commit was successful.
Public eventTransactionRolledback
Raised when Rollback was successful.
Top
Explicit Interface Implementations
  NameDescription
Explicit interface implementationPrivate propertyITransactionControllerIsTransactionInProgress
Gets IsTransactionInProgress. True when there is a transaction in progress.
Top
See Also