Path: news.easynews.com!core-easynews!newsfeed1.easynews.com!easynews.com!easynews!diablo.voicenet.com!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr13.news.prodigy.com.POSTED!10a1c2a2!not-for-mail From: "Dave Hau" Newsgroups: comp.databases.oracle.server References: Subject: Re: OCIReset() always fails Lines: 111 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: NNTP-Posting-Host: 67.127.52.37 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr13.news.prodigy.com 1054913048 ST000 67.127.52.37 (Fri, 06 Jun 2003 11:24:08 EDT) NNTP-Posting-Date: Fri, 06 Jun 2003 11:24:08 EDT Organization: SBC http://yahoo.sbc.com X-UserInfo1: OHXQBUSE]JVYCFD[LZKJOPHAWB\^PBQLGPQRJVMHQAVTUZ]CLNTCPFK[WDXDHV[K^FCGJCJLPF_D_NCC@FUG^Q\DINVAXSLIFXYJSSCCALP@PB@\OS@BITWAH\CQZKJMMD^SJA^NXA\GVLSRBD^M_NW_F[YLVTWIGAXAQBOATKBBQRXECDFDMQ\DZFUE@\JM Date: Fri, 06 Jun 2003 15:24:08 GMT Xref: core-easynews comp.databases.oracle.server:188877 X-Received-Date: Fri, 06 Jun 2003 08:24:20 MST (news.easynews.com) Try patching your OCI library to 8.1.7.4. In the list of bugs fixed for 8.1.7.4, I see this bug: 8174 2265777 OCIBreak() -> OCIReset() does not close the cursor (can lead to ORA-1000) which could potentially cause the OCIReset() to return error (because the cursor is still open). Here's the bug description: PROBLEM: -------- Customer built his application with OCI8.1.7.2.0. After OCIBreak() -> OCIReset() are called, the cursor is left open. So, customer's program eventually gets ORA-1000. . .. The calls OCI functions following sequence. . 1. OCIHandleAlloc(stmthp) 2. OCIStmtPrepare(stmthp) 3. OCIStmtExecute(stmthp) 4. OCIBreak(svchp) 5. OCIReset(svchp) 4. OCIHandleFree(stmthp) 5. OCITransCommit() 6. go back to 1. . The cursor opened at 3 won't close until session is terminated. HTH, Cheers, Dave "Knut Stolze" wrote in message news:bbq6he$d73$1@fsuj29.rz.uni-jena.de... > Hi, > > I run into something with non-blocked OCI calls that I can't explain myself > and, thus, don't know how to correct. I have the following code: > > ----- snip ---------------- > int cnt = 0; > while ((rc = OCIStmtExecute(serviceContext, stmtHandle, errorHandle, > 1, 0, NULL, NULL, OCI_DEFAULT)) == OCI_STILL_EXECUTING) { > cnt++; > if (cnt == 10000) { > rc2 = OCIBreak(serviceContext, errorHandle); > printf("OCIBreak() returned with rc %d\n", rc2); > rc2 = OCIReset(serviceContext, errorHandle); > printf("OCIReset() returned with rc %d\n", rc2); > break; > } > } > ---- snip ---------------- > > The output is always this: > > OCIBreak() returned with rc 0 > OCIReset() returned with rc -1 > OCI Error 1013: ORA-01013: user requested cancel of current operation > > > What I don't understand is why the OCIReset() call fails in the first place. > From the OCI Reference, I gather that OCIBreak() must always be followed by > an OCIReset() call. > > If I try a subsuquent OCIStmtExecute() with the same parameters as shown > above, I still get OCI_STILL_EXECUTING. So the loop would not terminate > without the "break" statement. If I add another OCIReset(), then I get > "ORA-01010: invalid OCI operation". > > I would welcome any comments to correct the problem. (I hope it's just me who > did something wrong.) > > The operating system is AIX 4.3.3 and Oracle version 8.1.7. > > -- > Knut Stolze