#include <ocipl.h>
Public Types | |
typedef OciHandleWrapper < OCISvcCtx > | super |
typedef OCISvcCtx | HandleType |
Public Member Functions | |
OciContext (OciEnv &env, OCISvcCtx *ctx) | |
void | commit (ub4 flags=OCI_DEFAULT) |
void | rollback (ub4 flags=OCI_DEFAULT) |
void | set_state (OCI_STATE state) |
void | set_state (OCI_STATE state, int stmt_type) |
void | reset_state () |
bool | maybe_active_transaction () const |
operator HandleType * () | |
Static Public Member Functions | |
static ub4 | get_type_id () |
static ub4 | get_attr_id () |
Public Attributes | |
OCI_STATE | _state |
int | _stmt_type |
int | _trans_cnt |
Protected Attributes | |
HandleType * | _handle |
Private Attributes | |
OciEnv & | _env |
Definition at line 885 of file ocipl.h.
typedef OCISvcCtx OCIPL::OciHandleWrapper< OCISvcCtx >::HandleType [inherited] |
typedef OciHandleWrapper<OCISvcCtx> OCIPL::OciContext::super |
OCIPL::OciContext::OciContext | ( | OciEnv & | env, |
OCISvcCtx * | ctx | ||
) | [inline] |
Definition at line 889 of file ocipl.h.
: super(ctx), _state(OS_NONE), _stmt_type(0), _trans_cnt(0), _env(env) { }
void OCIPL::OciContext::commit | ( | ub4 | flags = OCI_DEFAULT ) |
Definition at line 372 of file ocipl.cpp.
References _env, OCIPL::OciEnv::_errh, OCIPL::OciHandleWrapper< OCISvcCtx >::_handle, _trans_cnt, OCIPL::oci_check_error(), and OCIPL::OS_TRANSACTION.
{ LocalOciState state(*this, OS_TRANSACTION); sword res = OCITransCommit(_handle, _env._errh, flags); oci_check_error(_env, res); _trans_cnt = 0; }
static ub4 OCIPL::OciHandleID< OCISvcCtx >::get_attr_id | ( | ) | [static, inherited] |
static ub4 OCIPL::OciHandleID< OCISvcCtx >::get_type_id | ( | ) | [static, inherited] |
bool OCIPL::OciContext::maybe_active_transaction | ( | ) | const [inline] |
Definition at line 928 of file ocipl.h.
{ return _trans_cnt > 0; }
OCIPL::OciHandleWrapper< OCISvcCtx >::operator HandleType * | ( | ) | [inline, inherited] |
void OCIPL::OciContext::reset_state | ( | ) | [inline] |
Definition at line 922 of file ocipl.h.
References OCIPL::OS_NONE.
{ _state = OS_NONE; _stmt_type = 0; }
void OCIPL::OciContext::rollback | ( | ub4 | flags = OCI_DEFAULT ) |
Definition at line 383 of file ocipl.cpp.
References _env, OCIPL::OciEnv::_errh, OCIPL::OciHandleWrapper< OCISvcCtx >::_handle, _trans_cnt, OCIPL::oci_check_error(), and OCIPL::OS_TRANSACTION.
{ LocalOciState state(*this, OS_TRANSACTION); sword res = OCITransRollback(_handle, _env._errh, flags); oci_check_error(_env, res); _trans_cnt = 0; }
void OCIPL::OciContext::set_state | ( | OCI_STATE | state ) | [inline] |
void OCIPL::OciContext::set_state | ( | OCI_STATE | state, |
int | stmt_type | ||
) | [inline] |
Definition at line 910 of file ocipl.h.
References OCIPL::OS_EXECUTE.
{ //assert(_state==OS_NONE); // problematisch bei gleichzeitigem Zugriff auf die Datenbankverbindung aus mehreren Threads _state = state; _stmt_type = stmt_type; if (state == OS_EXECUTE) if ((stmt_type>=OCI_STMT_UPDATE && stmt_type<=OCI_STMT_INSERT) || stmt_type==OCI_STMT_BEGIN || stmt_type==OCI_STMT_DECLARE) ++_trans_cnt; }
OciEnv& OCIPL::OciContext::_env [private] |
Definition at line 938 of file ocipl.h.
Referenced by commit(), and rollback().
HandleType* OCIPL::OciHandleWrapper< OCISvcCtx >::_handle [protected, inherited] |
Definition at line 502 of file ocipl.h.
Referenced by commit(), and rollback().
Definition at line 935 of file ocipl.h.
Referenced by commit(), and rollback().