CSLA.NET 6.0.0
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
Csla.Data.TransactionManager< C, T > Class Template Reference

Provides an automated way to reuse open database connections and associated ADO.NET transactions within the context of a single data portal operation. More...

Inheritance diagram for Csla.Data.TransactionManager< C, T >:
Csla.Core.IUseApplicationContext

Public Member Functions

TransactionManager< C, T > GetManager (string database)
 Gets the TransactionManager object for the specified database. More...
 
TransactionManager< C, T > GetManager (string database, string label)
 Gets the TransactionManager object for the specified database. More...
 
TransactionManager< C, T > GetManager (string database, bool isDatabaseName)
 Gets the TransactionManager object for the specified database. More...
 
TransactionManager< C, T > GetManager (string database, bool isDatabaseName, string label)
 Gets the TransactionManager object for the specified database. More...
 
void Commit ()
 Indicates that the current transactional scope has completed successfully. More...
 
void Dispose ()
 Dispose object, dereferencing or disposing the connection it is managing. More...
 

Properties

Transaction [get]
 Gets a reference to the current ADO.NET transaction object. More...
 
Connection [get]
 Gets a reference to the current ADO.NET connection object that is associated with current trasnaction. More...
 
int RefCount [get]
 Gets the current reference count for this object. More...
 
- Properties inherited from Csla.Core.IUseApplicationContext
ApplicationContext ApplicationContext [getset]
 Gets or sets the current ApplicationContext object. More...
 

Detailed Description

Provides an automated way to reuse open database connections and associated ADO.NET transactions within the context of a single data portal operation.

Template Parameters
CType of database connection object to use.
TType of ADO.NET transaction object to use.

This type stores the open ADO.NET transaction in Csla.ApplicationContext.LocalContext and uses reference counting through IDisposable to keep the transaction open for reuse by child objects, and to automatically dispose the transaction when the last consumer has called Dispose."

Type Constraints
C :IDbConnection 
C :new() 
T :IDbTransaction 

Definition at line 38 of file TransactionManager.cs.

Member Function Documentation

◆ Commit()

void Csla.Data.TransactionManager< C, T >.Commit ( )

Indicates that the current transactional scope has completed successfully.

If all transactional scopes complete successfully the transaction will commit when the TransactionManager object is disposed.

Definition at line 200 of file TransactionManager.cs.

◆ Dispose()

void Csla.Data.TransactionManager< C, T >.Dispose ( )

Dispose object, dereferencing or disposing the connection it is managing.

Definition at line 258 of file TransactionManager.cs.

◆ GetManager() [1/4]

TransactionManager< C, T > Csla.Data.TransactionManager< C, T >.GetManager ( string  database)

Gets the TransactionManager object for the specified database.

Parameters
databaseDatabase name as shown in the config file.

Definition at line 58 of file TransactionManager.cs.

◆ GetManager() [2/4]

TransactionManager< C, T > Csla.Data.TransactionManager< C, T >.GetManager ( string  database,
bool  isDatabaseName 
)

Gets the TransactionManager object for the specified database.

Parameters
databaseThe database name or connection string.
isDatabaseNameTrue to indicate that the Transaction string should be retrieved from the config file. If False, the database parameter is directly used as a Transaction string.
Returns
TransactionManager object for the name.

Definition at line 90 of file TransactionManager.cs.

◆ GetManager() [3/4]

TransactionManager< C, T > Csla.Data.TransactionManager< C, T >.GetManager ( string  database,
bool  isDatabaseName,
string  label 
)

Gets the TransactionManager object for the specified database.

Parameters
databaseThe database name or connection string.
isDatabaseNameTrue to indicate that the Transaction string should be retrieved from the config file. If False, the database parameter is directly used as a Transaction string.
labelLabel for this transaction.
Returns
TransactionManager object for the name.

Definition at line 110 of file TransactionManager.cs.

◆ GetManager() [4/4]

TransactionManager< C, T > Csla.Data.TransactionManager< C, T >.GetManager ( string  database,
string  label 
)

Gets the TransactionManager object for the specified database.

Parameters
databaseDatabase name as shown in the config file.
labelLabel for this transaction.

Definition at line 71 of file TransactionManager.cs.

Property Documentation

◆ Connection

C Csla.Data.TransactionManager< C, T >.Connection
get

Gets a reference to the current ADO.NET connection object that is associated with current trasnaction.

Definition at line 183 of file TransactionManager.cs.

◆ RefCount

int Csla.Data.TransactionManager< C, T >.RefCount
get

Gets the current reference count for this object.

Definition at line 214 of file TransactionManager.cs.

◆ Transaction

T Csla.Data.TransactionManager< C, T >.Transaction
get

Gets a reference to the current ADO.NET transaction object.

Definition at line 170 of file TransactionManager.cs.