Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> OCI with threads

OCI with threads

From: Vladimir Schukin <schukin_at_ntvplus.com>
Date: Thu, 17 Dec 1998 19:04:09 +0300
Message-ID: <75b9en$kd0$1@bison.rosnet.ru>


Hi All!
I've got a problem.
Environment:
Oracle Enterprise Server 8.0.4.2.1
Digital Unix 4.0D

The using of fork() or PL/SQL-scripts is not desirable due to the technical assignment.
I've tried to initialize Oracle session in thread (pthread) and got the following exception:



Internal AIO consistency error: Cannot use libaio_raw with threads.
        Either relink without -pthread or link -laio, not -laio_raw.
            Aborting

exception system: exiting due to internal error: exception dispatch or unwind stuck in infinite loop

There is the same situation when I run the Java-application Net8 Assistent.

Remark:
1) The including of the following switch -laio into the compilation string has no effect.
2) In case of change -lclntsh and -lpthread by places I have got the following result

  1. -lclntsh -lpthread The exception placed above is rised.
  2. -lpthread -lclntsh The application work properly until the call of OCIServerAttach. After call of that function the application is ended with generation of core-file

Compilation string:

rm -f ornagra
rm -f core
cc -I/cdrom/rdbms/public -I/cdrom/plsql/public -I/u01/app/oracle/product/8.0
.4/network/public -L/u01/app/oracle/product/8.0.4/lib -rpath /u01/app/oracle/product/8.0.4/lib -o ornagra server.c -lclntsh -lpthread

A piece of code:
void* OraProcess(void* ptr)
{

    int st=0;
    int procStatus;
    if((procStatus = OraInitialization()) != OCI_SUCCESS)

            return;
    printf("Init\n");
/* if((procStatus = OraAttachServer()) != OCI_SUCCESS)

            return;
    printf("Attach\n");
    if((procStatus = OraLogin()) != OCI_SUCCESS)

            return;
    printf("Login\n");
    if((procStatus = OraLogOut()) != OCI_SUCCESS)

            return;
*/

    printf("LogOut\n");
    pthread_exit((void*)}

/////////////////////////////////////////////////

void main(void)
{

    int pInt,*kl;
    printf("Thread\n");
    pthread_create(oraclePid, 0, OraProcess, (void*) pInt);     printf("gh\n");
    pthread_join(oraclePid,(void*)kl);
    printf("End\n");
}

Thank you in advance for any suggestion. Vladimir Received on Thu Dec 17 1998 - 10:04:09 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US