There is an error in the log that says:
ORA-01461: can bind a LONG value only for insert into a LONG column
no other useful info really. I tried to follow up on the code, google-d the problem and I think I might have found the problem, but unfortunately I do not have Oracle database or anything really (even the code isn't present to me, I'm writing all this from memory and notes :( ) So the only thing I can guess based on the code (and lots of googling) is the String mapping to varchar2. Some environment info:
Hibernate: 3.2.1.ga
Driver: ojdbc6-11.2.0.2.0.jar
Database: 11.2.0.2.0 - 64bit
The table has multiple varchar2(300 byte) and one varchar2(4000 byte), lets call this last one TEXT. I checked the entity, and in it's column annotation these fields have a restriction of 300 bytes to its value, even the TEXT (4000 byte) field! So that's one strange point. My wild guess is that a String comes, bigger then 300 BYTE, and this is the error that gets printed into the log when trying to persist (stack trace points where the code tries to persist an instance of this entity). Sadly I only have that log to go on.. :( Is my guess likely? Or it's going to be something else?
Here's the entity field:
@Column(name = "TEXT", nullable = false, length = varcharLength)
public String getText() {
return text;
}
Here is the create statement (the essential part anyway):
CREATE TABLE "TABLENAME"
(
"ID" VARCHAR2(300 BYTE) NOT NULL ENABLE,
"VERSION" NUMBER(10,0),
"TEXT" VARCHAR2(4000 BYTE) NOT NULL ENABLE,
"PUBLISH_DATE" DATE NOT NULL ENABLE,
PRIMARY KEY ("ID")
);
(And the table has an index on PUBLISH_DATE, if that is relevant at all.)
org.hibernate.dialect.Oracle10gDialect
asOracleDialect
is deprecated: docs.jboss.org/hibernate/core/3.2/api/org/hibernate/dialect/… – a_horse_with_no_name