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

Breadcrumb

May 4th

Question and Answer

Chris Saxon

Thanks for the question, kevin.

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

Last updated: December 06, 2019 - 2:45 pm UTC

Version: Oracle12.2

Viewed 1000+ times

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.

https://docs.oracle.com/en/database/oracle/oracle-database/12.2/lnoci/deprecated-oci-functions.html#GUID-9AAA282E-CCF4-4D93-9C04-4351E61E693F


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 Chris said...

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

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

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

kevin xu, December 06, 2019 - 2:05 am UTC

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

SQL

The Oracle documentation contains a complete SQL reference.