Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> GLOBAL transactions - OCI_TRANS_TIGHT - ORA-00161
I have an application that needs to perform multiple concurrent
transactions. To accomplish this I'm trying to use Oracle's Global
Transactions. However, I'm having a problem with the OCITransStart()
function.
I'm trying to establish multiple branches to operate in a single session and I can't figure out why my call to "(OCITransStart(phService, phErr, 0, OCI_TRANS_TIGHT)" is generating an error message. I'm getting error code 161, with the error message "ORA-00161: transaction branch length 536871073 is illegal (maximum allowed 64)." You can see the context of this call in the code segment below.
I'm under a tight time constraint and I'd appreciate ANY suggestions that you may have.
Massis
if (OCISessionBegin ((OCISvcCtx *) phService, phErr, phSess,
OCI_CRED_RDBMS, OCI_DEFAULT))
{
ErrHandler((dvoid *) phErr, OCI_HTYPE_ERROR);
return OCI_ERROR;
}
if (OCIAttrSet ((dvoid *) phService, OCI_HTYPE_SVCCTX,
(dvoid *) phSess, (ub4) 0, OCI_ATTR_SESSION, phErr)) // associate user
session with SRVCTX
{
ErrHandler((dvoid *) phErr, OCI_HTYPE_ERROR);
return OCI_ERROR;
}
/* ESTABLISH A NEW TRANSACTION AND EXECUTE SELECT * FROM SIMPLE_TBL WHERE
TBL_ID = 1 */
if (OCIHandleAlloc ((dvoid *) phEnv, (dvoid **) &phTransK1,
OCI_HTYPE_TRANS, 0, (dvoid **) 0))
{
ErrHandler((dvoid *) phEnv, OCI_HTYPE_ENV);
return OCI_ERROR;
}
if (OCIAttrSet ((dvoid *) phService, (ub4) OCI_HTYPE_SVCCTX,
(dvoid *) phTransK1, (ub4) 0, OCI_ATTR_TRANS, phErr)) // set server
context
{
ErrHandler((dvoid *) phErr, OCI_HTYPE_ERROR);
return OCI_ERROR;
}
strcpy((char *)txtTransName, "TRANS1"); nTransLen = strlen((char *) txtTransName);
if (OCIAttrSet ((dvoid *) phTransK1, (ub4) OCI_HTYPE_TRANS,
(dvoid *) "TRANS1", (ub4) 6, OCI_ATTR_TRANS_NAME, phErr)) // set server
context
{
ErrHandler((dvoid *) phErr, OCI_HTYPE_ERROR);
return OCI_ERROR;
}
if (OCITransStart(phService, phErr, 0, OCI_TRANS_TIGHT)) /* START NEW TRANS
*/
{
ErrHandler((dvoid *) phErr, OCI_HTYPE_ERROR);
return OCI_ERROR;
}
Received on Tue Oct 02 2001 - 12:51:34 CDT