Oracle OCI

Posted on 2003-11-19
Last Modified: 2011-09-20
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));

Question by:babuvt
LVL 13

Expert Comment

ID: 9779640
Are you using RAC?
LVL 22

Accepted Solution

earth man2 earned 50 total points
ID: 9796319

Do you really require a OCI_TRANS_TWOPHASE commit ?

If so your transaction needs to be controlled with the following steps:

1 OCITransStart 1234      OCI_TRANS_NEW    Starts new read-only transaction
2 SQL UPDATE              Update rows
3 OCITransDetach           Transaction is detached
4 OCITransStart 1234      OCI_TRANS_RESUME Transaction is resumed
6 OCITransPrepare          Transaction prepared for two-phase commit
7 OCITransCommit          OCI_TRANS_TWOPHASE  Transaction is committed.

ie I guess you are missing steps 3,4,6.


Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now