如下函数,但调用该函数时m_status总是返回OCI_INVALID_HANDLE,我确认m_svchp,m_errhp是有效的,在执行时,这些函数OCIStmtExecute、OCITransCommit、OCITransRollback中都能正常执行。OCISvcCtx *m_svchp;
OCIError *m_errhp;
sb4 m_status;
bool COCILink::transstart()
{
m_status = OCITransStart(m_svchp,
m_errhp,
60,
OCI_TRANS_NEW);
if ( OCI_SUCCESS != m_status )
{
return false;
}
return true;
}
哪位能否告知是怎么回事。
OCIError *m_errhp;
sb4 m_status;
bool COCILink::transstart()
{
m_status = OCITransStart(m_svchp,
m_errhp,
60,
OCI_TRANS_NEW);
if ( OCI_SUCCESS != m_status )
{
return false;
}
return true;
}
哪位能否告知是怎么回事。
XID gxid;
gxid.formatID = 1000; /* format id = 1000 */
gxid.gtrid_length = 3; /* gtrid = 123 */
gxid.data[0] = 1; gxid.data[1] = 2; gxid.data[2] = 3;
gxid.bqual_length = 1; /* bqual = 1 */
gxid.data[3] = 1;
OCIAttrSet((dvoid *)txnhp1, OCI_HTYPE_TRANS, (dvoid *)&gxid, sizeof(XID),
OCI_ATTR_XID, errhp);
http://www.oracle86.com/ora_doc/appdev.111/b28419/d_xa.htm?jdfwkey=zu16c#BABJDGGHDBMS_XA_XID Object Type
The PL/SQL XA interface allows the PL/SQL application to define a global transaction branch id (XID) and associate/disassociate the current session with the transaction branch. XID is defined as a PL/SQL object type.See Also:For more information, see "Distributed Transaction Processing: The XA Specification" in the public XA Standard.
SyntaxTYPE DBMS_XA_XID IS OBJECT(
formatid NUMBER,
gtrid RAW(64),
bqual RAW(64),
constructor function DBMS_XA_XID(
gtrid IN NUMBER)
RETURN SELF AS RESULT,
constructor function DBMS_XA_XID (
gtrid IN RAW,
bqual IN RAW)
RETURN SELF AS RESULT,
constructor function DBMS_XA_XID(
formatid IN NUMBER,
gtrid IN RAW,
bqual IN RAW DEFAULT HEXTORAW('00000000000000000000000000000001'))
RETURN SELF AS RESULT)