Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> OCI with threads
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:
Either relink without -pthread or link -laio, not -laio_raw. Aborting
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
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
![]() |
![]() |