Link to home
Start Free TrialLog in
Avatar of babuvt
babuvt

asked on

Oracle OCI

Hi all,
 
I am currently facing error messages while I do commit after any new updation or insertion in a table using OCI function( OCITransCommit ). Kindly help me in resolving this problem.
 
Below is the error message I am getting :
Fri May 14 08:45:16 1999>>>The ERROR CODE is:24762
Fri May 14 08:45:16 1999>>>The ERROR MSG is:ORA-24762: server failed due to unspecified error
 
whose internal information is

ORA-24762 server failed due to unspecified error
Cause: An internal error has occurred in the server commit protocol.

Action: Contact Oracle Customer Support.

If I try to commit in the sqlplus prompt , its working fine,  but through program I am not able to set.
 
Is there any command or statement to be executed before doing anything with commit. I had created handlers for env,error,server , service , set the attributes of server to service, statement handlers and then tried OCIlogon. Please let me know if I have missed something.
 
Along with this Mail, I have pasted my code for your perusal.
 
OCIEnvCreate((OCIEnv **)&envhp , OCI_DEFAULT, 0, 0, 0, 0, 0, 0);
OCIHandleAlloc((dvoid *)envhp, (dvoid**)&errhp, OCI_HTYPE_ERROR, 0, 0)
OCIHandleAlloc((dvoid *)envhp, (dvoid **)&srvhp, OCI_HTYPE_SERVER, 0, 0)
OCIServerAttach(srvhp,errhp, (text*) "tiscali", strlen("tiscali"), (ub4) OCI_DEFAULT);
OCIHandleAlloc((dvoid *)envhp, (dvoid **)&svchp, OCI_HTYPE_SVCCTX, 0, 0);
OCIHandleAlloc((dvoid *)envhp, (dvoid**)&updateStmt, OCI_HTYPE_STMT, 0, 0);
OCIHandleAlloc((dvoid *)envhp, (dvoid**)&insertStmt, OCI_HTYPE_STMT, 0, 0);
OCIAttrSet((dvoid *)svchp,OCI_HTYPE_SVCCTX,(dvoid *)srvhp,0,OCI_ATTR_SERVER,errhp);
 
all the above statements are returning OCI_SUCESS.
 
void updateRecord(OCISvcCtx* svchp, OCIError* errhp,OCIStmt *updateStmt,unsigned long codeprovseq, char*  flagExported)
{  OCIBind *bndhp1, *bndhp2;
 
char updateQuery[] = "update provisioning_request set flag_exported = :flagExported, tmst_update = sysdate w
here code_provisioning_req_seq  = :codeprovseq and flag_exported = '0'";
 
checkerr(errhp,OCIStmtPrepare(updateStmt, errhp,(OraText*)updateQuery,(ub4) strlen(updateQuery), OCI_NTV_SYNTAX, OCI_DEFAULT));
 
checkerr(errhp, OCIBindByName(updateStmt, &bndhp1, errhp, (text *)":flagExported", (sb4) -1, (dvoid *) flagE
xported, (sb4) strlen(flagExported)+1, SQLT_STR, (dvoid *)0, (ub2 *)0, (ub2 *)0, (ub4)0, (ub4 *)0, (ub4) OCI_DEFAULT));
 
checkerr(errhp, OCIBindByName(updateStmt, &bndhp2, errhp, (text *)":codeprovseq", (sb4) -1, (dvoid *) &codeprovseq, (sb4) sizeof(codeprovseq), SQLT_NUM, (dvoid *)0, (ub2 *)0, (ub2 *)0, (ub4)0, (ub4 *)0, (ub4) OCI_DEFAULT));
 
checkerr(errhp,OCIStmtExecute(svchp, updateStmt, errhp, (ub4) 1, (ub4) 0, (OCISnapshot *) NULL, (OCISnapshot *) NULL, (ub4) OCI_DEFAULT));
/*Till this there is no error getting popped up */

/*failing here */
checkerr(errhp, OCITransCommit(svchp, errhp, (ub4)OCI_TRANS_TWOPHASE));

}
Avatar of anand_2000v
anand_2000v
Flag of India image

Are you using RAC?
ASKER CERTIFIED SOLUTION
Avatar of earth man2
earth man2
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial