Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Trouble with ORA-01013 user requested cancel of current operation
Hello,
the following simple Pro*C program connects to the database, then makes a query in an infinite loop. It runs a while, then gets ORA-01013 as if the user had canceled, although the keys are not touched. The number of queries after it happens is different at each run, but in the magnitude order of many thousands.
Environment:
WinNT 4.0 Workstation, Oracle 8.0.5.0.0 Client Software (incl. Pro*C)
AIX 4.2 Server, Oracle 7.3.2 RDBMS, SQL*Net over TCP/IP
Any help would be helpful.
L.K.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <sqlca.h>
#include <sqlcpr.h>
void SQL_err(void)
{
char err_msg[512];
unsigned int buf_len = sizeof (err_msg), msg_len;
time_t atime;
sqlglm(err_msg, &buf_len, &msg_len);
err_msg[msg_len] = '\0';
time(&atime);
fprintf(stderr,"%s\n", ctime(&atime));
fprintf(stderr,"%s\n", err_msg);
return ;
}
int main(int argc, char **argv)
{
EXEC SQL BEGIN DECLARE SECTION;
VARCHAR usrpwd_str[101];
int count;
EXEC SQL END DECLARE SECTION;
int i;
char *usr_pwd="commtest/commtest_at_uxcom";
usrpwd_str.len = strlen(usr_pwd);
strcpy( (char *) usrpwd_str.arr, usr_pwd);
EXEC SQL CONNECT :usrpwd_str ;
if(SQLCODE < 0) {
SQL_err(); exit(1); }
i=1;
while(1) {
EXEC SQL SELECT COUNT(*) INTO :count FROM COMM;
if(SQLCODE != 0) {
SQL_err(); break;
EXEC SQL COMMIT WORK RELEASE; if(SQLCODE < 0) {
SQL_err(); exit(1); }
exit(0);
}
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Fri Feb 19 1999 - 02:56:25 CST