⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oramts.h

📁 将对Oracle数据库读写操作的OCI进行封装。不但具有普通数据的读取操作
💻 H
📖 第 1 页 / 共 2 页
字号:
/*             enlist the connection, perform work, deenlist the connection,  */
/*             then release the connection and then attempt to commit or abrt.*/
/*             For nonpooled connections, one must allocate a transaction han */
/*             dle and assosciate the OCI service context with that handle.The*/
/*             transaction handle must be undisturbed till the service context*/
/*             is finally disposed off. Once a nonpooled connection has been  */
/*             enlisted, it can be detached and attached to the underlying Ora*/
/*             cle transaction via the same call using the dwFlags parameter. */
/*             If one needs to detach from the Oracle transaction lpTrans is  */
/*             NULL and dwFlags is ORAMTS_ENFLG_DETCHTX. If one wants to resum*/
/*             the current transaction lpTrans is not NULL and dwFlags is set */
/*             to ORAMTS_ENFLG_RESUMTX.                                       */
/*----------------------------------------------------------------------------*/
DWORD OraMTSSvcEnlist(
                       OCISvcCtx  *OCISvc, 
                       OCIError   *OCIErr, 
                       void       *lpTrans, 
                       unsigned    dwFlags
                     );
/*----------------------------------------------------------------------------*/
/* Name      : OraMTSSvcEnlistEx()                                            */
/* Purpose   : Enlist an OCI connection or service context in a DTC-trans.    */
/* Arguments : OCISvcCtx *OCISvc  : (IN ) OCI service context for pooled conn.*/
/*             OCIError  *OCIErr  : (IN/OUT) OCI error handle for errors. This*/
/*             is ignored if the service context represents a pooled conn.    */
/*             void      *lpTrans : (IN ) ptr. to DTC-controlled transaction  */
/*             unsigned   dwFlags : (IN ) enlistment flags                    */
/*	       char	 *lpDBName: (IN ) Net8 dbalias (connect alias).	      */
/* Returns   : ORAMTSERR_NOERROR on success.                                  */
/* Notes     : An OCI service context obtained via a previous call to OraMTSS-*/
/*             vcGet() or allocated otherwise, is enlisted via this call in a */
/*             DTC-transaction. For pooled connections, the underlying session*/
/*             object must be explicitly enlistable. A subsequent call to the */
/*             same function with a NULL lpTrans will cause deenlistment from */
/*             the transaction. Callers should allocate a connection, then    */
/*             enlist the connection, perform work, deenlist the connection,  */
/*             then release the connection and then attempt to commit or abrt.*/
/*             For nonpooled connections, one must allocate a transaction han */
/*             dle and assosciate the OCI service context with that handle.The*/
/*             transaction handle must be undisturbed till the service context*/
/*             is finally disposed off. Once a nonpooled connection has been  */
/*             enlisted, it can be detached and attached to the underlying Ora*/
/*             cle transaction via the same call using the dwFlags parameter. */
/*             If one needs to detach from the Oracle transaction lpTrans is  */
/*             NULL and dwFlags is ORAMTS_ENFLG_DETCHTX. If one wants to resum*/
/*             the current transaction lpTrans is not NULL and dwFlags is set */
/*             to ORAMTS_ENFLG_RESUMTX. The lpDBName parameter is only used   */
/*             when enlisting non-pooled connections. The parameter is used to*/
/*	       cache information regarding the proxy service for the database */
/*	       to improve performance. This parameter is ignored for pooled   */
/*	       connections and also for de-enlistments.			      */
/*----------------------------------------------------------------------------*/
DWORD OraMTSSvcEnlistEx(
                       		OCISvcCtx  *OCISvc, 
				OCIError   *OCIErr, 
				void       *lpTrans, 
				unsigned    dwFlags,
				char	   *lpDBName
                       );
/*----------------------------------------------------------------------------*/
/* Name      : OraMTSEnlCtxGet()					      */
/* Purpose   : Create an enlistment context for a non-pooled OCI connection.  */
/* Arguments : text*	  pUname :(IN ) database username for connection.     */
/*	       text*	  pPsswd :(IN ) database password for connection.     */
/*	       text*	  pDbnam :(IN ) database connect str for connection.  */
/*	       OCISvcCtx* pOCISvc:(IN ) OCI service context for pooled conn.  */
/*             OCIError*  pOCIErr:(IN ) OCI error handle for errors.	      */
/*	       ub4	  dwFlags:(IN ) enlistment flags. 0 is the only value */
/*				  currently allowed.			      */
/*	       void**	  pCtxt	 :(OUT) enlistment context to be created.     */
/*             is ignored if the service context represents a pooled conn.    */
/* Notes     : This call setus up anenlistment context for a non-pooled OCI   */
/*	       connection. This call must be issued just after the caller has */
/*	       established the OCI connection to the database. Once created   */
/*	       this context can be passed into kpntjoindtctxn() calls. Prior  */
/*	       to  tearing down the OCI connection kpntenlistctxrel() must be */
/*	       called to destroy the enlistment context.		      */
/* Returns   : ORAMTSERR_NOERROR on success.                                  */
/*----------------------------------------------------------------------------*/
DWORD OraMTSEnlCtxGet(
			text*		lpUname,
			text*		lpPsswd,
			text*		lpDbnam,              
			OCISvcCtx*	pOCISvc,
			OCIError*	pOCIErr,
			ub4		dwFlags,
			void**		pCtxt
		     );
/*----------------------------------------------------------------------------*/
/* Name      : OraMTSEnlCtxRel()					      */
/* Purpose   : Destroy the enlistment context for a non-pooled OCI connection.*/
/* Arguments : void* pCtxt : (IN ) enlistment context to destroy.	      */
/* Notes     : Before dropping a non-pooled OCI connection a client must call */
/*	       kpntenlistctxrel() to destroy any enlistment context it may    */
/*	       created for that connection. Since the enlistment context may  */
/*	       maintain OCI handles allocated off the connection's env handle */
/*	       it is imperative that the env handle not be deleted for the    */
/*	       of the assosciated enlistment context.			      */
/* Returns   : ORAMTSERR_NOERROR on success.                                  */
/*----------------------------------------------------------------------------*/
DWORD OraMTSEnlCtxRel(void* pCtxt);
/*----------------------------------------------------------------------------*/
/* Name      : OraMTSJoinTxn()						      */
/* Purpose   : Enlist an non-pooled OCI connection in an MSDTC-transaction.   */
/* Arguments : void* pCtxt : (IN ) enlistment context for the OCI connection  */
/*	       void* pTrans: (IN ) reference to MSDTC transaction object.     */
/* Notes     : This call is used by clients with non-pooled OCI connections to*/
/*	       enlist these connections in MSDTC-coordinated transactions. The*/
/*	       client passes in the opaque reference to the enlistment context*/
/*	       representing the OCI connection along with a reference to an   */
/*	       MSDTC transaction object. If pTrans is NULL the OCI connection */
/*	       is deenlisted from any MSDTC transaction it is currently enlis-*/
/*	       -ted in. It is perfectly legal to enlist a previously enlisted */
/*	       OCI connection in a different MSDTC transaction.		      */
/* Returns   : ORAMTSERR_NOERROR on success.                                  */
/*----------------------------------------------------------------------------*/
DWORD OraMTSJoinTxn(void *pCtxt, void* pTrans);
/*----------------------------------------------------------------------------*/
/* Name      : OraMTSTransTest()					      */
/* Purpose   : Test if we are running inside an MTS initiated transaction.    */
/* Arguments : - None -                                                       */
/* Returns   : TRUE if we are running inside an MTS transaction. FALSE other- */
/*	       wise.							      */
/* Notes     : This can be made by MTS transactional components to check if   */
/*	       component is executing within the context of an MTS transaction*/
/*	       Note, that this can only test MTS initiated transactions. Txns */
/*	       started by directly calling the MSDTC will not be detected.    */
/*----------------------------------------------------------------------------*/
BOOL OraMTSTransTest();
/*----------------------------------------------------------------------------*/
/* Name      : OraMTSOCIErrGet()					      */
/* Purpose   : Retrieve the OCI error (if any) from the last kpntsvc operation*/
/* Arguments : DWORD  *dwErr : (OUT) error code.			      */ 
/*	       LPTSTR lpcEMsg: (OUT) buffer for the error message if any.     */ 
/*	       DWORD  *lpdLen: (IN/OUT)	size of lpcEmsg in; msg bytes out.    */
/* Returns   : TRUE if an OCI error was encountered. FALSE otherwise. If TRUE */
/*	       and lpcEMsg and lpdLen are valid, and we do have a stashed err */
/*	       message, upto lpdLen bytes are copied into lpcEMsg. lpdLen is  */
/*	       set to the actual # of message bytes.			      */
/* Notes     : - None -							      */
/*----------------------------------------------------------------------------*/
BOOL OraMTSOCIErrGet(DWORD *dwErr, LPTSTR lpcEMsg, DWORD *lpdLen);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* ORACLE_ORAMTS */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -