Skip to Main Content
  • Questions
  • How can application control to explicitly call OCIStmtPrepare2 rather than OCIStmtPrepare when using pro*C



Connor and Chris don't just spend all day on AskTOM. You can also catch regular content via Connor's blog and Chris's blog. Or if video is more your thing, check out Connor's latest video and Chris's latest video from their Youtube channels. And of course, keep up to date with AskTOM via the official twitter account.

Question and Answer

Chris Saxon

Thanks for the question, kevin.

Asked: November 29, 2019 - 2:58 am UTC

Answered by: Chris Saxon - Last updated: December 06, 2019 - 2:45 pm UTC

Category: Database Development - Version: Oracle12.2

Viewed 100+ times

Whilst you are here, check out some content from the AskTom team: Shameless, I know. But it feels so good...

You Asked

Our application got an ORA-25412: transaction replay disabled by call to OCIStmtPrepare.

Oracle Version: 12.2.
The Oracle runs in RAC mode.

After searched on the internet, we found below explanation:

This call(OCIStmtPrepare) does not support Application Continuity and if this call is used, it returns the following error: Error - ORA-25412: transaction replay disabled by call to OCIStmtPrepare. Use the OCIStmtPrepare2() call to support the use of Application Continuity in an HA infrastructure.

We had tried to re-compile our application with 12.2 oracle client SDK but we found the client still call OCIStmtPrepare after we debugged.

As we are using proc*C in our application, we don't know how Oracle decide which version of OCIStmtPrepare will be used, and how to force control the Oracle client to call OCIStmtPrepare2 to avoid the issue when TAF take effective.

Is there any configuration can solve this issue? or we can only re-implement our Oracle operation module with OCI?

and we said...

The call to OCIStmtPrepare(2) will be in your application code.

So you need to change the application to use the correct function!

and you rated our response

  (1 rating)


December 06, 2019 - 2:05 am UTC

Reviewer: kevin xu

Thanks for your response.

As we are using pro*C, not use OCI functions directly(no call of OCIStmtPrepare/OCIStmtPrepare2 in the source code, but OCIStmtPrepare is called in background and which version of the function to call isn't identified in compile procedure), so we want to know whether there's a solution in pro*C development mode.
Chris Saxon


December 06, 2019 - 2:45 pm UTC

What exactly does your Pro*C code look like?

More to Explore


The Oracle documentation contains a complete SQL reference.