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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
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, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

696 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