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 -> Re: OCITransStart Problem, starting simple readonly transaction

Re: OCITransStart Problem, starting simple readonly transaction

From: Kevin English <kenglish_at_4csoftware.com>
Date: Fri, 31 May 2002 22:35:15 -0600
Message-ID: <itigfu8s5smg1vuhitapldcbfup0hvo8sk@4ax.com>


On 31 May 2002 09:34:08 -0700, boileaub_at_hotmail.com (David B) wrote:

>I have an OCI application that run using the simple local transaction
>scheme. In this mode, transaction are initiated when an sql is sent, I
>commit the transaction using OCITransCommit() or OCITransRollback() to
>rollback.
>
>According to the Oracle OCI documentation, to start a read only
>transaction, I need to explicitly start the transaction using
>OCITransStart()
>
>So I added the following code for the read only local transaction :
>
>checkStatus(
> OCITransStart( _serviceContext,
>
>DbEnvOracle::getInstance().getErrorHandle(),
> 0,
> OCI_TRANS_NEW | OCI_TRANS_READONLY )
>);
>
>Running my application with this causes checkStatus() to fail ...
>OCITransStart return OCI_INVALID_HANDLE
>I know that _serviceContext and the error handle should be valid since
>my application works fine without OCITransStart().
>
>Do I have to manually allocate a transaction handle ? or am I missing
>a step...

Hi,
Have you allocated a transaction handle and set it into the service context, using OCIAttrSet(...OCI_ATTR_TRANS) ? Without doing that you will get the OCI_INVALID_HANDLE error from OCITransStart().
Cheers
Kevin English

 Posted Via Usenet.com Premium Usenet Newsgroup Services


Received on Fri May 31 2002 - 23:35:15 CDT

Original text of this message

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