1

We are experiencing problems with updating a table record BLOB column. We get the "ORA-03146: invalid buffer length for TTC field" error. We basically are saving e.g. PDF attachments to the DB. The problem occurred after the upgrade from Oracle 12.0.1.2 to 19c (19.3.0.0), now the error is occurring on a larger scale. We have a .Net application, connecting to Oracle through ODP.NET (Oracle.DataAccess) and using NHibernate. We have done an upgrade from Oracle 12.1.0.2 to Oracle 19.3.0.0 using DBUA and the DB server is on Windows 2012 platform.

The error occurs after executing the command: {OpsSqlPrepare2(): SQL: UPDATE SIRIUS.Attachment SET Request = :p0, LOANREQUEST = :p1, ARCHIVE = :p2, FILENAME = :p3, FILESIZE = :p4, BINARYCONTENT = :p5, ATTACHMENTTABLE = :p6, ATTACHMENTTYPE = :p7, NOTE = :p8, MIMETYPE = :p9, CUSTOMID = :p10, ISEXTERNAL = :p11, ISSEND = :p12, DocumentNameDial = :p13, DOCUMENTENUMTYPE = :p14, AttachmentTypeDial = :p15 WHERE ID = :p16}

BINARYCONTENT is a BLOB column.

The error is different from the two environments we have:

Oracle DB 19c/Oracle client 19c - ORA-03146: invalid buffer length for TTC field

Oracle DB 19c/Oracle client 12 - ORA-03138: Connection terminated due to security policy violation

2
  • 1
    What version are the Client Drivers? Did you contact Oracle Support? Did you check error logs? Commented Jan 14, 2021 at 14:32
  • the application is set to target .NET 4.5 framework, however the oracle.dataaccess.dll used (placed in application folder on IIS) is in version 2.122.19.1. I wonder if this could be the cause of the error. In more detail, the version used while developing the application (referenced from project) was 4.122.19.1.20190703. However, the customer now uses in application folder on IIS version 2.122.19.1.20190510. I did contact the Oracle support, but so far, no luck finding the cause. Commented Jan 14, 2021 at 18:26

1 Answer 1

1

JDBC application fails with ORA-03146: Invalid Buffer Length For TTC Field After Database Upgrade to 19c (Doc ID 2729562.1)

Updating a 12c database to 19.6 can result in this issue. In this particular case, the database was upgraded from 12.1.0.2.

The ORA-3137 [3146] is a protocol exception which means that the database has not consumed all the data from the user buffer for the long bind.

This issue is addressed in Bug:30955880 - ORA-3137 [3146] [4] / ORA-3137 [3146] [94] UPDATING LOB WITH LARGE BIND which was closed as duplicate of unpublished Bug 31625618 - DML OVER A LOB COLUMN USING LONG BIND FAILS WITH AN ORA-3137 [3146] ERROR WHEN THE BIND SIZE IS > 256K BYTES.

Then:

Bug 31625618 - DML Over a LOB Column Using Long Bind Fails with ORA-3137 [3146] [4] / ORA-3137 [3146] [94] When the Bind Size is > 256k Bytes (Doc ID 31625618.8)

Clients (JDBC/OCI) performing DML's on a LOB column intermittently fail with the below errors, when the bind length is > 256k bytes: ORA-03137: malformed TTC packet from client rejected: [3146] [4] ORA-03137: malformed TTC packet from client rejected: [3146] [94]
ORA-03146: invalid buffer length for TTC field

I quoted this part to highlight that this issue was not specific to JDBC.

Fix for Bug 31625618 exists as a oneoff patch for 19c versions below 19.10.

The bug is fixed in database version 19.10, which will be released next week.

Currently you are on 19.3. Apply the necessary patches.

4
  • I did check the document on Oracle support, but so far I did not find any patch for Windows x64 platform for bug 31625618. The fix will be included in the 19.10 version then? Will it be also available for Windows x64 platform? Commented Jan 14, 2021 at 18:28
  • 1
    @StepanBerkovsky These patches are typically released a few weeks later for Windows. That platform has low priority at Oracle. Commented Jan 14, 2021 at 18:37
  • OK, thank you for your quick answer. Can I do something now to prove that our problem is indeed caused by this bug and it will be fixed by the future patch? Commented Jan 14, 2021 at 20:33
  • Just to inform you, I asked Oracle support, whether there will be a patch for bug 31625618 for Windows platform and the current status is that they need to simulate the problem first and verify, if is indeed also a bug on Windows platform. Commented Jan 19, 2021 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.