-->
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: problem with Blob, Hibernate3 and Oracle 10g
PostPosted: Thu Jul 03, 2008 8:17 am 
Newbie

Joined: Thu Jul 03, 2008 7:51 am
Posts: 2
hello
on a oracle 10g database a defined a table as follows:

create table contact(
id number(22) primary key not null,
attachment blob,
attachmentname varchar2(255))
tablespace users
storage (initial 2M pctincrease 0)
lob (attachment) store AS (
tablespace users
storage (initial 10M)
enable storage in row
pctversion 5
chunk 1
index lob_attachment_idx (tablespace users storage (initial 1M)));

tying to fill this table throu hibernate it has the result that only small data is filled into the Blob. arond 200 chars max. i get no errormessage.

my hibernate class looks like the following:

@Entity
@Table(name="contact")
public class Contact extends APersistenceListable {

@Id
@SequenceGenerator(name="s_contact", sequenceName="s_contact", allocationSize=0)
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="s_contact")
private Long id;

@Lob
private Blob attachment;

@Length(max=255)
private String attachmentname;

public InputStream getBlobStream() throws SQLException {
if (getAttachment () == null) {
return null;
}
return getAttachment().getBinaryStream();
}

public void setBlobStream(InputStream sourceStream) throws IOException {
setAttachment (Hibernate.createBlob(sourceStream));
}
}

any solution for this problem?

dieter


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.