Re: calling OCI from proC in same transaction

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Tue, 16 Nov 1999 08:46:23 -0500
Message-ID: <pV4xOCK+7foM1h2U6Mz8Ae4y0CAB_at_4ax.com>


A copy of this was sent to dellera_at_my-deja.com (if that email address didn't require changing) On Tue, 16 Nov 1999 09:56:42 GMT, you wrote:

>Hi everybody,
>
>we have a problem here that I think
>it's of general interest.
>
>We use a product which is written in pro*c.
>We don't have any control on it, that is,
>neither we have the source code nor we
>can modify it and recompile.
>
>This product (a middleware, incidentally) manages
>an oracle database, committing (or rollbacking)
>its own transactions. We can add our own table management
>by writing a function (a hook) which is called just
>before the transaction commits; that way, we can have
>our data modifications in the _same_ transaction (that's the point)
>of the product's ones.
>
>We used to write that function in pro*c. It worked because
>in pro*c, if you don't CONNECT, automagically you use the
>already opened (implicit) one (which is our product's one,
>in our case).
>Now we would like to use OCI instead.
>
>Is it possible to have OCI inheriting the pro*c transaction,
>without any access to the (calling) pro*c code ?
>
>Thanks in advance, at least for your time
>Alberto
>
>
>
>
Yes, In v7 oci it would have looked like this:

static int firstTime = 1;
static Lda_Def lda;
static Cda_Def cda;

void my_function( ... )
{

   if ( firstTime )
   {

      sqllda( &lda );

      rc = oopen( &cda, &lda, NULL, -1, -1, NULL, -1 );
      if ( rc ) return NULL;

      firstTime = 0;

   }

   .....

[Quoted] It is similar but the API calls are different in v8 oci. (SQLSvcCtxGet or SQLEnvGet)

>
>
>
>
>
>
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

-- 
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
 
Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Tue Nov 16 1999 - 14:46:23 CET

Original text of this message