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.  [ 5 posts ] 
Author Message
 Post subject: URGENT!! Inserting into a Oracle CLOB field
PostPosted: Thu Mar 25, 2004 1:43 pm 
Newbie

Joined: Wed Mar 24, 2004 3:01 pm
Posts: 6
Hi! I really need help... I

_________________
Maikel A. Arabori - Curitiba/PR - Brazil


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 26, 2004 5:07 am 
Newbie

Joined: Sun Mar 14, 2004 1:43 am
Posts: 2
I have the same problem!!


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 21, 2004 11:32 am 
Newbie

Joined: Fri May 21, 2004 11:27 am
Posts: 1
Hi.

I wrote this in my hibernate.properties and works;

hibernate.jdbc.use_streams_for_binary=true
hibernate.jdbc.batch_size=0

Good luck!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 09, 2004 6:03 am 
Newbie

Joined: Tue Dec 16, 2003 12:02 pm
Posts: 14
Location: Geneva, Switzerland
Quote:
hibernate.jdbc.use_streams_for_binary=true
hibernate.jdbc.batch_size=0


this does not work for me: the whole data in the CLOB column gets deleted if I try to insert a text of more than 4000 char. I get no error message from hibernate. I am using Oracle 8i, this is the mapping:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="bacrule1.Organism" table="organism">
<id column="oscode" name="oscode" type="string" unsaved-value="null">
<generator class="assigned"/>
</id>
<property column="description" name="description" type="text"/>
<property column="internal" name="internal" type="string"/>
</class>
</hibernate-mapping>

anybody found a workaround?

what about this batch-size attribute ?


Top
 Profile  
 
 Post subject: This works for me. I did not use the UserType thogh.
PostPosted: Wed Jun 16, 2004 4:56 pm 
Newbie

Joined: Tue Feb 17, 2004 1:58 pm
Posts: 4
You must make sure you insert an empty clob. see Hibernate.createClob(" ")

orgDetail.setOdBusinessSummary(Hibernate.createClob(" "));
session.save(orgDetail);
session.flush();
session.refresh(orgDetail, LockMode.UPGRADE);
oracle.sql.CLOB bussinessSummaryClob = (oracle.sql.CLOB) orgDetail.getOdBusinessSummary();

Writer clobWriter = bussinessSummaryClob.getCharacterOutputStream();
clobWriter.write(bussinessSummaryData);
clobWriter.close();
//END Inserting a CLOB


tx.commit();
session.close();


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

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.