OCILIB (C and C++ Driver for Oracle)  4.7.5
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
Loading...
Searching...
No Matches
ocilib::Transaction Class Reference

Oracle Transaction object. More...

#include <types.hpp>

Inherits ocilib::core::HandleHolder< OCI_Transaction * >.

Public Types

enum  TransactionFlagsValues {
}
 Transaction flags enumerated values. More...
 
typedef core::Flags< TransactionFlagsValuesTransactionFlags
 Transaction flags.
 

Public Member Functions

 Transaction (const Connection &connection, unsigned int timeout, TransactionFlags flags, OCI_XID *pxid=nullptr)
 Create a new global transaction or a serializable/read-only local transaction.
 
void Prepare ()
 Prepare a global transaction validation.
 
void Start ()
 Start global transaction.
 
void Stop ()
 Stop current global transaction.
 
void Resume ()
 Resume a stopped global transaction.
 
void Forget ()
 Cancel the prepared global transaction validation.
 
TransactionFlags GetFlags () const
 Return the transaction mode.
 
unsigned int GetTimeout () const
 Return the transaction Timeout.
 

Detailed Description

Oracle Transaction object.

This class wraps the OCILIB object handle OCI_Transaction and its related methods

Definition at line 2377 of file types.hpp.

Member Typedef Documentation

◆ TransactionFlags

Member Enumeration Documentation

◆ TransactionFlagsValues

Transaction flags enumerated values.

Enumerator
New 

(Global) Specifies tightly coupled and migratable branch

Tight 

(Global) Specifies a tightly coupled branch

Loose 

(Global) Specifies a loosely coupled branch

ReadOnly 

(Global and local) start a read-only transaction

ReadWrite 

(Global and local) start a read-write transaction

Serializable 

(Global and local) start a serializable transaction

Definition at line 2388 of file types.hpp.

Constructor & Destructor Documentation

◆ Transaction()

ocilib::Transaction::Transaction ( const Connection connection,
unsigned int  timeout,
TransactionFlags  flags,
OCI_XID *  pxid = nullptr 
)
inline

Create a new global transaction or a serializable/read-only local transaction.

Parameters
connection- Connection
timeout- Time that a transaction stays inactive after being stopped
flags- Transaction flags
pxid- pointer to a global transaction identifier structure
Note
For local transaction, don't use the 'pxid' parameter

Definition at line 30 of file Transaction.hpp.

References ocilib::core::Check(), and OCI_TransactionCreate().

Member Function Documentation

◆ Prepare()

void ocilib::Transaction::Prepare ( )
inline

Prepare a global transaction validation.

Definition at line 44 of file Transaction.hpp.

References ocilib::core::Check(), and OCI_TransactionPrepare().

◆ Start()

void ocilib::Transaction::Start ( )
inline

Start global transaction.

Definition at line 49 of file Transaction.hpp.

References ocilib::core::Check(), and OCI_TransactionStart().

◆ Stop()

void ocilib::Transaction::Stop ( )
inline

Stop current global transaction.

Definition at line 54 of file Transaction.hpp.

References ocilib::core::Check(), and OCI_TransactionStop().

◆ Resume()

void ocilib::Transaction::Resume ( )
inline

Resume a stopped global transaction.

Definition at line 59 of file Transaction.hpp.

References ocilib::core::Check(), and OCI_TransactionResume().

◆ Forget()

void ocilib::Transaction::Forget ( )
inline

Cancel the prepared global transaction validation.

Definition at line 64 of file Transaction.hpp.

References ocilib::core::Check(), and OCI_TransactionForget().

◆ GetFlags()

Transaction::TransactionFlags ocilib::Transaction::GetFlags ( ) const
inline

Return the transaction mode.

Note
: see Transaction() for possible values

Definition at line 69 of file Transaction.hpp.

References ocilib::core::Check(), and OCI_TransactionGetMode().

◆ GetTimeout()

unsigned int ocilib::Transaction::GetTimeout ( ) const
inline

Return the transaction Timeout.

Definition at line 74 of file Transaction.hpp.

References ocilib::core::Check(), and OCI_TransactionGetTimeout().