Syntax

C#
public class TransactionScope

The type exposes the following members.

Public Constructors

  NameDescription
Public methodTransactionScopeTransactionScopeNewOverloaded.

Public Methods

  NameDescription
Public methodCreateObjRef
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
(Inherited from MarshalByRefObject.)
Public methodDispose
Disposes the specified discard changes.
(Inherited from SessionScope.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodFailSession
This is called when a session has a failure
(Overrides SessionScope..::FailSession(ISession).)
Public methodFlush
Flushes the sessions that this scope is maintaining
(Inherited from AbstractScope.)
Public methodGetHashCode
Serves as a hash function for a particular type. GetHashCode()() is suitable for use in hashing algorithms and data structures like a hash table.
(Inherited from Object.)
Public methodGetLifetimeService
Retrieves the current lifetime service object that controls the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Public methodGetSession
This method should return the session instance associated with the key.
(Overrides AbstractScope..::GetSession(Object).)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInitializeLifetimeService
Obtains a lifetime service object to control the lifetime policy for this instance.
(Inherited from MarshalByRefObject.)
Public methodIsKeyKnown
This method is invoked when the ISessionFactoryHolder instance needs a session instance. Instead of creating one it interrogates the active scope for one. The scope implementation must check if it has a session registered for the given key. TransactionScope..::RegisterSession(Object, ISession)
(Overrides AbstractScope..::IsKeyKnown(Object).)
Public methodOpenSession
If the WantsToCreateTheSession returned true then this method is invoked to allow the scope to create a properly configured session
(Inherited from AbstractScope.)
Public methodRegisterSession
This method is invoked when no session was available at and the ISessionFactoryHolder just created one. So it registers the session created within this scope using a key. The scope implementation shouldn't make any assumption on what the key actually is as we reserve the right to change it TransactionScope..::IsKeyKnown(Object)
(Overrides AbstractScope..::RegisterSession(Object, ISession).)
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Public methodVoteCommit
Votes to commit the transaction
Public methodVoteRollBack
Votes to roll back the transaction

Protected Methods

  NameDescription
Protected methodDiscardSessions
Discards the sessions.
(Overrides AbstractScope..::DiscardSessions(ICollection<(Of <ISession>)>).)
Protected methodEnsureHasTransaction
Ensures that a transaction exist, creating one if neccecary
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Protected methodInitialize
Initializes the current transaction scope using the session
(Overrides AbstractScope..::Initialize(ISession).)
Protected methodMemberwiseClone
Creates a shallow copy of the current MarshalByRefObject object.
(Inherited from MarshalByRefObject.)
Protected methodPerformDisposalOverloaded.
Protected methodSetFlushMode
Sets the flush mode.
(Inherited from AbstractScope.)

Protected Fields

  NameDescription
Protected fieldkey2Session
Map between a key to its session
(Inherited from AbstractScope.)

Public Properties

  NameDescription
Public propertyFlushAction
Returns the FlushAction defined for this scope
(Inherited from AbstractScope.)
Public propertyHasSessionError
Gets or sets a flag indicating whether this instance has session error.
(Inherited from SessionScope.)
Public propertyScopeType
Returns the SessionScopeType defined for this scope
(Inherited from AbstractScope.)
Public propertyWantsToCreateTheSession
Implementors should return true if they want that their scope implementation be in charge of creating the session
(Inherited from AbstractScope.)

Public Events

  NameDescription
Public eventOnTransactionCompleted
This event is raised when a transaction is completed

See Also