[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3100?page=c...
]
James Carman commented on HHH-3100:
-----------------------------------
Nevermind! It's the Oracle JDBC driver. The following straight JDBC code throws an
exception also:
Class.forName("oracle.jdbc.OracleDriver");
Connection conn =
DriverManager.getConnection("jdbc:oracle:thin:@mydatabaseserver:1521:mysid",
"myuser", "mypassword");
PreparedStatement ps = conn.prepareStatement("insert into HHH_BUG_TWO_STRING
(id,string1,string2) values (?,?,?)" );
ps.setString(1, UUID.randomUUID().toString());
ps.setString(2, repeat('X', 3999));
ps.setString(3, repeat('Y', 3999));
ps.executeUpdate();
ps.close();
conn.close();
I guess I'll try to find a driver from them that doesn't cause this issue. Sorry
for the SPAM.
Hibernate Fails on More Than One VARCHAR2(4000) Property
--------------------------------------------------------
Key: HHH-3100
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3100
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.5
Environment: Java Version:
java version "1.5.0_14"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
Java HotSpot(TM) Client VM (build 1.5.0_14-b03, mixed mode, sharing)
Hibernate Version:
3.2.5.ga
Oracle Database Version:
Oracle, version: Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
Oracle Driver Version:
Oracle JDBC driver, version: 10.2.0.3.0
Reporter: James Carman
If I have more than one long string (mapped to a varchar2(4000) column) within my entity
class, Hibernate fails with:
"java.sql.BatchUpdateException: ORA-01461: can bind a LONG value only for insert
into a LONG column"
My class looks like (Entity is a superclass that defines the id, equals, hashCode):
public class TwoString extends Entity {
private String string1;
private String string2;
public TwoString() {
}
public TwoString( String string1, String string2 ) {
this.string1 = string1;
this.string2 = string2;
}
// Getters and setters here...
}
My mapping document looks like:
<hibernate-mapping>
<class name="com.carmanconsulting.hibernate.bug.TwoString"
table="HHH_BUG_TWO_STRING">
<id name="id">
<generator class="assigned" />
</id>
<property name="string1" length="4000" />
<property name="string2" length="4000" />
</class>
</hibernate-mapping>
My code looks like:
Configuration cfg = new Configuration();
SessionFactory sf = cfg.configure().buildSessionFactory();
Session s = sf.openSession();
try {
Transaction tx = s.beginTransaction();
s.save(new TwoString(repeat('Y', 3999), repeat('Z', 3999)));
tx.commit();
}
finally {
s.close();
sf.close();
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira