[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


Oracle OCI

Posted on 2003-11-19
Medium Priority
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 100 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

656 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