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: oracle JDBC - how to detect uncommitted work on an open Connection ?

Re: oracle JDBC - how to detect uncommitted work on an open Connection ?

From: mcstock <mcstock_at_enquery.com>
Date: Thu, 30 Oct 2003 18:17:20 -0500
Message-ID: <t_mdnVWg__syATyiRVn-ig@comcast.com>


i can't think of any default way to find out about open transactions, but you could create a view (either owned by SYS or by a user that has privileges granted by SYS like this:

CREATE OR REPLACE VIEW MY_TRANSACTION ( SID, START_SCNB, START_SCNW ) AS select
s.sid
, t.start_scnb
, t.start_scnw
from
 v$session s
, v$transaction t
where
s.saddr = t.ses_addr
and
s.AUDSID = USERENV('SESSIONID')

then create a public synonym and grant select to public -- selecting from the view will then show if there is an open transaction.

"Edoardo" <e.comar.no.spam_at_no.spam.btinternet.com> wrote in message news:bns3dh$ckk$2_at_hercules.btinternet.com...
> Hi
>
> is there a way, using Oracle's JDBC drivers to find out if a given
> java.sql.Connection has uncommitted work pending on it ???
>
> the reason is, close() will commit work if there is any - while if the
> close happens as a cleanup action after an error, it would be desirable
> to rollback (but I don't want to rollback always before close).
>
> TIA.
> Edoardo Comar
> www.choreology.com
>
>
>
>
Received on Thu Oct 30 2003 - 17:17:20 CST

Original text of this message

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