Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ORA-01461 / BLOB / Hibernate

Tags:

java

oracle

jdbc

I have one instance of Oracle Database 10.2.0.4. I have java-application based on spring framework 3.0.5, hibernate 3.5.6. I have a table with BLOB column (blobContent BLOB) and an entity with java.sql.Blob field (mapped in hibernate XML-mapping as <property name="blobContent" type="blob"/>). I use Oracle10gDialect.

I get ORA-01461 periodically trying to insert row in this table. I tried several Oracle JDBC drivers (10.2.0.4, 10.2.0.5 and 11.2.0.3) with no any success. My googling and searching metalink database for this problem failed. I decompiled Oracle JDBC-driver and checked code starting at method oracle.jdbc.driver.OraclePreparedStatement.setBinaryStream(int, InputStream, long) thru oracle.jdbc.driver.DBConversion till oracle.jdbc.driver.OracleConversionInputStream.

Everything looks OK as far as this code can be considered OK :)

Please advise how to trace this problem... may be at Oracle side (?)... may be looking for some implicit casting... May be I missed some known Oracle metalink article regarding this problem?

like image 247
svaor Avatar asked Mar 14 '13 17:03

svaor


1 Answers

I consider following oracle bug as a main cause of my errors. After upgrading database I'll check problem again and accept my own answer. I hope it will be useful for someone else.

By the way our platform is also AIX/64x.

Oracle Bug 9018715 "INTERMITTENT ORA-1461 IN UPDATES AND INSERTS WITH NO LONG COLUMN TYPES"

Type B - Defect

Fixed in Product Version 11.1.0.7.0

Severity 2 - Severe Loss of Service

Product Version 10.2.0.4.0

Status 93 - Closed, Not Verified by Filer

Platform 212 - IBM AIX on POWER Systems (64-bit)

Created Oct 14, 2009

Platform Version 5.3

Updated Dec 27, 201

Base Bug N/A

Database Version 10.2.0.4.0

Affects Platforms Generic

Product Source Oracle

PROBLEM:

ORA-1461: can bind a LONG value only for insert into a LONG column is received frequently in client applications.

The error is seen in insert and update statements, and for different tables. The statements are of this type: Insert into columns (, , ,..) values (:1, :2, :3, ...:n); or update set = :1, = :2, = :3,.. = :n where =:m; And none of the columns are of type lONG.

DIAGNOSTIC ANALYSIS:

The error started to appear after having upgraded rdbms from 10.2.0.3 to 10.2.0.4. It is occuring frequently, and on different tables. Once the error has occured, reexecuting the same sql often succeeds.

Database characterset : WE8ISO8859P15. Windows client. NLS settings: NLS_LANG=American_America.WE8ISO8859P15.

The applications are connecting via Jdbc thin driver version 10.2.0.1. A test with jdbc driver version 10.1.0.5 also fails.

like image 154
svaor Avatar answered Nov 19 '22 04:11

svaor