Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: OCI - how can I start readonly transaction without defining global XID, how to check the transaction level...
On Fri, 11 Jan 2002 10:47:37 -0500, Marcin Kasperski wrote:
> According to Oracle documentation (OCI programmer guide, chapter 8
> "Managing Scalable Platforms", chapter "Transactions"), it is possible to
> start serializable or read-only local transactions using OCITransStart
> call with appropriate attributes and this approach is faster than ALTER
> SESSION. Unfortunately, there is no example (neither in the documentation
> mentioned, nor in samples present in Oracle distribution).
>
> I tried naive approach, running just
>
> OCITransStart(svcHandle, errorHandle, 0,
> OCI_TRANS_READONLY | OCI_TRANS_NEW);
>
> (and the version with the OCI_TRANS_READONLY without OCI_TRANS_NEW) but
> while running it I get:
>
> ORA-00942: table or view does not exist
>
> I suspect that the error message is invalid and that the real problem
> arises from the fact that I do _not_ create my own transaction handle and
> I do _not_ bind the global xid to it. But ... I do not want to do it. I
> just want to influence 'default' transaction, the one which is implicitly
> created within default service context. Is it possible?
>
> And the strongly related question: is it possible to check whether some
> transaction is currently active? I would like to check somehow whether
> someone missed to commit/rollback or not...
Being active or inactive is an attribute of the executing session and not transaction. Therefore, you look into v$session which has a field called 'STATUS'. Some of the values are "ACTIVE","INACTIVE","KILLED" and "PSEUDO". There is a ton of tools which can show you the status of your session (OEM, TOra, TOAD, HAWK, ORAC_DBA)
-- Mladen GogalaReceived on Fri Jan 11 2002 - 21:54:32 CST