-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Updating CLOB fields > 4K characters yields null
PostPosted: Wed Oct 25, 2006 3:30 pm 
Newbie

Joined: Thu Oct 12, 2006 11:33 am
Posts: 1
Location: Boston
I cannot update CLOB fields that are longer than 4000 characters.

When saving a record with a CLOB field, mapped as @Lob, if the java string property is longer than 4000 characters, a null is inserted. If <4000 characters, it updates correctly.

Is this a limitation with hibernate or Oracle, or am I doing something wrong?

Hibernate version: 3.1

Mapping documents:
@Lob
@NotNull
@Column(name="session_data")
public String getSessionData() {
return sessionData;
}
public void setSessionData(String sessionData) {
this.sessionData = sessionData;
}

Code between sessionFactory.openSession() and session.close():
// dao is my data access object
// sesInfo1 is an instance of the class that has the mapped property, sessionData
String oldData = sesInfo1.getSessionData();
sesInfo1.setSessionData("You should not see me");
dao.save(sesInfo1);
dao.commitTransaction();
sesInfo1.setSessionData(oldData);

dao.saveOrUpdate(sesInfo1);
dao.commitTransaction();
dao.close();

Full stack trace of any exception that occurs:
No stack trace

Name and version of the database you are using:
Database 10g Express Edition Release 10.2.0.1.0

The generated SQL (show_sql=true):
Hibernate: select session_info_seq.nextval from dual
Hibernate: insert into session_info (session_code, lastmodified, external_identifier, session_data, session_id) values (?, ?, ?, ?, ?)
Hibernate: update session_info set session_code=?, lastmodified=?, external_identifier=?, session_data=? where session_id=? and lastmodified=?
Hibernate: select * from ( select this_.session_id as session1_24_0_, this_.session_code as session2_24_0_, this_.lastmodified as lastmodi3_24_0_, this_.external_identifier as external4_24_0_, this_.session_data as session5_24_0_ from session_info this_ where this_.external_identifier=? ) where rownum <= ?

_________________
Reuben Fisher
Principal Software Engineer, Houghton-Mifflin


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.