Q: Compiling multi-threaded OCI app on AIX.

Q: Compiling multi-threaded OCI app on AIX.

Post by s.. » Sun, 31 Dec 1899 09:00:00



Hello!

Have anybody compiled multi-threaded OCI application on AIX using xlc_r
or xlC_r? According to Oracle documentation
OCI libraries are thread-safe since Oracle 7.3. My environment is Oracle
7.3.4 and AIX 4.2.
I can compile the program by xlC_r but during the execution it
terminates with:

ORA-01041: internal error. hostdef extension doesn't exist

When compiling by xlc it works fine. The prgram is as follows:

#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>

#include <ociapr.h>

#define HDA_SIZE 256

int
main()
{
        Lda_Def lda;
        ub1 hda[HDA_SIZE];
        text *uid = (unsigned char *)"user";
        text *passwd = (unsigned char *)"password";
        text *dbinst = (unsigned char *)"db_alias";

        opinit(OCI_EV_TSF);

        if( olog(&lda, (unsigned char *)&hda,
                         uid, -1, passwd, -1, dbinst, -1,
                         OCI_LM_DEF) )
        {
                unsigned char msg[128];
                sb2 errcode = ((Cda_Def *)&lda)->rc;
                (void) oerhms(&lda, errcode, msg, (sword) sizeof msg);
                fprintf(stderr, "%s\n", msg);
                exit(1);
        }

/* skipped */

        ologof(&lda);
        return 0;

Quote:}

Any hints will be useful.

Thanks in advance,
Serguei Afonin, MSU