Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: TAF and FCF together ?

Re: TAF and FCF together ?

From: <kuassi.mensah_at_gmail.com>
Date: 16 Sep 2006 23:22:26 -0700
Message-ID: <1158474146.657659.58030@i3g2000cwc.googlegroups.com>


Joe,

See elements of response inline

joeNOSPAM_at_BEA.com wrote:
> Hi Kuassi, what I'm looking for is a JDBC-specific list of
> clear best-practices and limitations that describe what
> a programmer needs to do to make TAF and the Oracle
> JDBC driver work together.
>
> 1 - That document seems to state that some queries will
> *not* survive failover, whether with a delay or not. Is this
> true?

Yes, TAF will not always successfully restart a query in progress. It reopens the cursors and attempts to discard rows already returned. In order to achieve that, it performs a chekcsum of to-be-discarded rows and compares that checksum against a checksum for the rows already returned. If the checksums are different, TAF knows the discarded rows are not the same as the rows already returned. In such a case, it will not resume returning rows and returns an error. Checksum discrepancies are more likely to happen with replica databases which are not block-for-block identical.

> 2 - If I am in a transaction during a transparent failover,
> what behavior will the Oracle driver exhibit that informs
> me to roll back my transaction?

JDBC is just a conduit b/w the RDBMS and TAF. (i) Upon node/instance failure, the connection is dead and all in-flight transactions are automatically rolled-back by the RDBMS. (ii) The JDBC Connection is failed/switched over by TAF. (iii) TAF issues an exception. (iv) TAF requires an ACK. (v) The application rolls back the transaction (which can be see as an ACK to TAF) and replays the transaction.

> 3 - If I have a set of PreparedStatements in my application
> that I am continually re-using, will the failover ever affect
> them and/or the DBMS cursors on which they depend?
>

To my knowledge, PreparedStatement and their cursor are re-openned/executed. However If the application uses any stored procedures (i.e., CallableStatement), then the state of those procedures is lost after failover.

> 4 - In cases where TAF is rerunning an in-flight query under-
> the-covers, to get it back to where it was before the failover, I
> have some questions. I am told that the position of the
> new cursor is defined by fetching through the same *number*
> of rows as had been fetched by the previous cursor. Given the
> sizeable delay that may occur before the new cursor is
> even started, is there any chance that the underlying data
> may have changed so the new cursor counts past (and misses)
> some new rows, and is set up to re-return rows that have
> already been seen before the failover?

See #1

> Thanks for your help on this,
> Joe Weinstein
>
> kuassi.mensah_at_gmail.com wrote:
> > Hi Joe,
> >
> > These are very good questions that anyone contemplating TAF should
> > investigate..
> > I have discussed some of these in my book (chapter 7) and fairness
> > towards those who bought it suggests that i only give the following
> > summary:
> > a) things that TAF does well (transparently): connection failover and
> > query resubmit (or query failover) - with performance penalty
> > b) things that TAF does not do well (not transparent or does not work
> > at all): rolling back active transaction, and failing over session
> > states
> >
> > As of 10g R2, FCF is bound to RAC while TAF may be used to failover
> > single-instance sites (Data Guard); TAF may also be customized through
> > its callback interface.
> >
> > Hope this helps, Kuassi
> >
> > joeNOSPAM_at_BEA.com wrote:
> > > Hi Kuassi, could you discuss the ramifications of these
> > > TAF considerations as it relates to JDBC?
> > >
> > > (metalink registration required)
> > > http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=97926.1
> > >
> > > Under what conditions would a running JDBC application
> > > suffer from "Continuing work on existing cursors may raise an error
> > > (eg: ORA-25401 "cannot continue fetches")"? Will existing
> > > PreparedStatements
> > > ever become defunct?
> > >
> > > When will JDBC queries fail with "Failed over selects may raise an
> > > error"
> > > and what error?
> > >
> > > Do JDBC connections ever rely on having altered the session state with
> > > such calls as "ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD';"
> > > or global temp tables, which will be lost on failover?
> > >
> > > If a JDBC client is using the Oracle OCI driver, doing transactions,
> > > how/when
> > > to they know that a failover occurred so they know to roll back?
> > >
> > > thanks,
> > > Joe
Received on Sun Sep 17 2006 - 01:22:26 CDT

Original text of this message

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