CSLA.NET 5.4.2
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 >:

Public Member Functions

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...
 

Static Public Member Functions

static TransactionManager< C, T > GetManager (string database)
 Gets the TransactionManager object for the specified database. More...
 
static TransactionManager< C, T > GetManager (string database, string label)
 Gets the TransactionManager object for the specified database. More...
 
static TransactionManager< C, T > GetManager (string database, bool isDatabaseName)
 Gets the TransactionManager object for the specified database. More...
 
static TransactionManager< C, T > GetManager (string database, bool isDatabaseName, string label)
 Gets the TransactionManager object for the specified database. 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...
 

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 37 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 196 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 254 of file TransactionManager.cs.

◆ GetManager() [1/4]

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

Gets the TransactionManager object for the specified database.

Parameters
databaseDatabase name as shown in the config file.

Definition at line 54 of file TransactionManager.cs.

◆ GetManager() [2/4]

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

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 86 of file TransactionManager.cs.

◆ GetManager() [3/4]

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

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 106 of file TransactionManager.cs.

◆ GetManager() [4/4]

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

Gets the TransactionManager object for the specified database.

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

Definition at line 67 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 179 of file TransactionManager.cs.

◆ RefCount

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

Gets the current reference count for this object.

Definition at line 210 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 166 of file TransactionManager.cs.