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
Best Answer
JDBC application fails with ORA-03146: Invalid Buffer Length For TTC Field After Database Upgrade to 19c (Doc ID 2729562.1)
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)
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.