Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: OCIReset() always fails
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.
.
.
The cursor opened at 3 won't close until session is terminated.
HTH,
Cheers,
Dave
"Knut Stolze" <stolze_at_informatik.uni-jena.de> wrote in message
news:bbq6he$d73$1_at_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
Received on Fri Jun 06 2003 - 10:24:08 CDT