📄 oro.h
字号:
/*---------------------------------------------------------------------------*/
/* OBJECT CACHE */
/*---------------------------------------------------------------------------*/
/* To enable object change detection mode, set this to TRUE */
#define OCI_ATTR_OBJECT_DETECTCHANGE 0x00000020
/* To enable object creation with non-NULL attributes by default, set the
following to TRUE.
By default, object is created with NULL attributes
*/
#define OCI_ATTR_OBJECT_NEWNOTNULL 0x00000010
/* To enable sorting of the objects that belong to the same table
before being flushed through OCICacheFlush.
Please note that by enabling this object cache will not be flushing
the objects in the same order they were dirtied */
#define OCI_ATTR_CACHE_ARRAYFLUSH 0x00000040
/*--------------------------- OBJECT PIN OPTION -----------------------------*/
enum OCIPinOpt
{
/* 0 = uninitialized */
OCI_PIN_DEFAULT = 1, /* default pin option */
OCI_PIN_ANY = 3, /* pin any copy of the object */
OCI_PIN_RECENT = 4, /* pin recent copy of the object */
OCI_PIN_LATEST = 5 /* pin latest copy of the object */
};
typedef enum OCIPinOpt OCIPinOpt;
/*
* OCIPinOpt - OCI object Pin Option
*
* In the Oracle object runtime environment, the program has the option to
* specify which copy of the object to pin.
*
* OCI_PINOPT_DEFAULT pins an object using the default pin option. The default
* pin option can be set as an attribute of the OCI environment handle
* (OCI_ATTR_PINTOPTION). The value of the default pin option can be
* OCI_PINOPT_ANY, OCI_PINOPT_RECENT, or OCI_PIN_LATEST. The default option
* is initialized to OCI_PINOPT_ANY.
*
* OCI_PIN_ANY pins any copy of the object. The object is pinned
* using the following criteria:
* If the object copy is not loaded, load it from the persistent store.
* Otherwise, the loaded object copy is returned to the program.
*
* OCI_PIN_RECENT pins the latest copy of an object. The object is
* pinned using the following criteria:
* If the object is not loaded, load the object from the persistent store
* from the latest version.
* If the object is not loaded in the current transaction and it is not
* dirtied, the object is refreshed from the latest version.
* Otherwise, the loaded object copy is returned to the program.
*
* OCI_PINOPT_LATEST pins the latest copy of an object. The object copy is
* pinned using the following criteria:
* If the object copy is not loaded, load it from the persistent store.
* If the object copy is loaded and dirtied, it is returned to the program.
* Otherwise, the loaded object copy is refreshed from the persistent store.
*/
/*--------------------------- OBJECT LOCK OPTION ----------------------------*/
enum OCILockOpt
{
/* 0 = uninitialized */
OCI_LOCK_NONE = 1, /* null (same as no lock) */
OCI_LOCK_X = 2, /* exclusive lock */
OCI_LOCK_X_NOWAIT = 3 /* exclusive lock, do not wait */
};
typedef enum OCILockOpt OCILockOpt;
/*
* OCILockOpt - OCI object LOCK Option
*
* This option is used to specify the locking preferences when an object is
* loaded from the server.
*/
/*------------------------- OBJECT MODIFYING OPTION -------------------------*/
enum OCIMarkOpt
{
/* 0 = uninitialized */
OCI_MARK_DEFAULT = 1, /* default (the same as OCI_MARK_NONE) */
OCI_MARK_NONE = OCI_MARK_DEFAULT, /* object has not been modified */
OCI_MARK_UPDATE /* object is to be updated */
};
typedef enum OCIMarkOpt OCIMarkOpt;
/*
* OCIMarkOpt - OCI object Mark option
*
* When the object is marked updated, the client has to specify how the
* object is intended to be changed.
*/
/*-------------------------- OBJECT Duration --------------------------------*/
typedef ub2 OCIDuration;
#define OCI_DURATION_INVALID 0xFFFF /* Invalid duration */
#define OCI_DURATION_BEGIN (OCIDuration)10
/* beginning sequence of duration */
#define OCI_DURATION_NULL (OCIDuration)(OCI_DURATION_BEGIN-1)
/* null duration */
#define OCI_DURATION_DEFAULT (OCIDuration)(OCI_DURATION_BEGIN-2) /* default */
#define OCI_DURATION_USER_CALLBACK (OCIDuration)(OCI_DURATION_BEGIN-3)
#define OCI_DURATION_NEXT (OCIDuration)(OCI_DURATION_BEGIN-4)
/* next special duration */
#define OCI_DURATION_SESSION (OCIDuration)(OCI_DURATION_BEGIN)
/* the end of user session */
#define OCI_DURATION_TRANS (OCIDuration)(OCI_DURATION_BEGIN+1)
/* the end of user transaction */
/******************************************************************************
** DO NOT USE OCI_DURATION_CALL. IT IS UNSUPPORTED **
** WILL BE REMOVED/CHANGED IN A FUTURE RELEASE **
******************************************************************************/
#define OCI_DURATION_CALL (OCIDuration)(OCI_DURATION_BEGIN+2)
/* the end of user client/server call */
#define OCI_DURATION_STATEMENT (OCIDuration)(OCI_DURATION_BEGIN+3)
/* This is to be used only during callouts. It is similar to that
of OCI_DURATION_CALL, but lasts only for the duration of a callout.
Its heap is from PGA */
#define OCI_DURATION_CALLOUT (OCIDuration)(OCI_DURATION_BEGIN+4)
#define OCI_DURATION_LAST OCI_DURATION_CALLOUT /* last of predefined durations */
/* This is not being treated as other predefined durations such as
SESSION, CALL etc, because this would not have an entry in the duration
table and its functionality is primitive such that only allocate, free,
resize memory are allowed, but one cannot create subduration out of this
*/
#define OCI_DURATION_PROCESS (OCIDuration)(OCI_DURATION_BEGIN-5)
/*
* OCIDuration - OCI object duration
*
* A client can specify the duration of which an object is pinned (pin
* duration) and the duration of which the object is in memory (allocation
* duration). If the objects are still pinned at the end of the pin duration,
* the object cache manager will automatically unpin the objects for the
* client. If the objects still exist at the end of the allocation duration,
* the object cache manager will automatically free the objects for the client.
*
* Objects that are pinned with the option OCI_DURATION_TRANS will get unpinned
* automatically at the end of the current transaction.
*
* Objects that are pinned with the option OCI_DURATION_SESSION will get
* unpinned automatically at the end of the current session (connection).
*
* The option OCI_DURATION_NULL is used when the client does not want to set
* the pin duration. If the object is already loaded into the cache, then the
* pin duration will remain the same. If the object is not yet loaded, the
* pin duration of the object will be set to OCI_DURATION_DEFAULT.
*/
/*----------------------------- OBJECT PROPERTY -----------------------------*/
/******************************************************************************
** DO NOT USE OCIObjectProperty. IT IS UNSUPPORTED **
** WILL BE REMOVED/CHANGED IN A FUTURE RELEASE **
******************************************************************************/
enum OCIObjectProperty
{
/* 0 = uninitialized */
OCI_OBJECTPROP_DIRTIED = 1, /* dirty objects */
OCI_OBJECTPROP_LOADED, /* objects loaded in the transaction */
OCI_OBJECTPROP_LOCKED /* locked objects */
};
typedef enum OCIObjectProperty OCIObjectProperty;
/*
* OCIObjectProperty -- OCI Object Property
* This specifies the properties of objects in the object cache.
*/
/*------------------------- CACHE REFRESH OPTION ---------------------------*/
enum OCIRefreshOpt
{
/* 0 = uninitialized */
OCI_REFRESH_LOADED = 1 /* refresh objects loaded in the transaction */
};
typedef enum OCIRefreshOpt OCIRefreshOpt;
/*
* OCIRefreshOpt - OCI cache Refresh Option
* This option is used to specify the set of objects to be refreshed.
*
* OCI_REFRESH_LOAD refreshes the objects that are loaded in the current
* transaction.
*/
/*-------------------------------- OBJECT EVENT -----------------------------*/
/******************************************************************************
** DO NOT USE OCIObjectEvent. IT IS UNSUPPORTED **
** WILL BE REMOVED/CHANGED IN A FUTURE RELEASE **
******************************************************************************/
enum OCIObjectEvent
{
/* 0 = uninitialized */
OCI_OBJECTEVENT_BEFORE_FLUSH = 1, /* before flushing the cache */
OCI_OBJECTEVENT_AFTER_FLUSH, /* after flushing the cache */
OCI_OBJECTEVENT_BEFORE_REFRESH, /* before refreshing the cache */
OCI_OBJECTEVENT_AFTER_REFRESH, /* after refreshing the cache */
OCI_OBJECTEVENT_WHEN_MARK_UPDATED, /* when an object is marked updated */
OCI_OBJECTEVENT_WHEN_MARK_DELETED, /* when an object is marked deleted */
OCI_OBJECTEVENT_WHEN_UNMARK, /* when an object is being unmarked */
OCI_OBJECTEVENT_WHEN_LOCK /* when an object is being locked */
};
typedef enum OCIObjectEvent OCIObjectEvent;
/*
* OCIObjectEvent -- OCI Object Event
* This specifies the kind of event that is supported by the object
* cache. The program can register a callback that is invoked when the
* specified event occurs.
*/
/*----------------------------- OBJECT COPY OPTION --------------------------*/
#define OCI_OBJECTCOPY_NOREF (ub1)0x01
/*
* OCIObjectCopyFlag - Object copy flag
*
* If OCI_OBJECTCOPY_NOREF is specified when copying an instance, the
* reference and lob will not be copied to the target instance.
*/
/*----------------------------- OBJECT FREE OPTION --------------------------*/
#define OCI_OBJECTFREE_FORCE (ub2)0x0001
#define OCI_OBJECTFREE_NONULL (ub2)0x0002
#define OCI_OBJECTFREE_HEADER (ub2)0x0004
/*
* OCIObjectFreeFlag - Object free flag
*
* If OCI_OBJECTCOPY_FORCE is specified when freeing an instance, the instance
* is freed regardless it is pinned or diritied.
* If OCI_OBJECTCOPY_NONULL is specified when freeing an instance, the null
* structure is not freed.
*/
/*----------------------- OBJECT PROPERTY ID -------------------------------*/
typedef ub1 OCIObjectPropId;
#define OCI_OBJECTPROP_LIFETIME 1 /* persistent or transient or value */
#define OCI_OBJECTPROP_SCHEMA 2 /* schema name of table containing object */
#define OCI_OBJECTPROP_TABLE 3 /* table name of table containing object */
#define OCI_OBJECTPROP_PIN_DURATION 4 /* pin duartion of object */
#define OCI_OBJECTPROP_ALLOC_DURATION 5 /* alloc duartion of object */
#define OCI_OBJECTPROP_LOCK 6 /* lock status of object */
#define OCI_OBJECTPROP_MARKSTATUS 7 /* mark status of object */
#define OCI_OBJECTPROP_VIEW 8 /* is object a view object or not? */
/*
* OCIObjectPropId - OCI Object Property Id
* Identifies the different properties of objects.
*/
/*----------------------- OBJECT LIFETIME ----------------------------------*/
enum OCIObjectLifetime
{
/* 0 = uninitialized */
OCI_OBJECT_PERSISTENT = 1, /* persistent object */
OCI_OBJECT_TRANSIENT, /* transient object */
OCI_OBJECT_VALUE /* value object */
};
typedef enum OCIObjectLifetime OCIObjectLifetime;
/*
* OCIObjectLifetime - OCI Object Lifetime
* Classifies objects depending upon the lifetime and referenceability
* of the object.
*/
/*----------------------- OBJECT MARK STATUS -------------------------------*/
typedef uword OCIObjectMarkStatus;
#define OCI_OBJECT_NEW 0x0001 /* new object */
#define OCI_OBJECT_DELETED 0x0002 /* object marked deleted */
#define OCI_OBJECT_UPDATED 0x0004 /* object marked updated */
/*
* OCIObjectMarkStatus - OCI Object Mark Status
* Status of the object - new or updated or deleted
*/
/* macros to test the object mark status */
#define OCI_OBJECT_IS_UPDATED(flag) bit((flag), OCI_OBJECT_UPDATED)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -