-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate and Blobs
PostPosted: Thu Aug 26, 2004 2:12 pm 
Beginner
Beginner

Joined: Thu Jul 22, 2004 8:09 am
Posts: 20
I am getting a java.sql.SQLException: ORA-01002: fetch out of sequence while trying to do a refersh, basically select for update? How do I set autocommit to false? Any help is appreciated.

Hibernate version:
2.1.6

Mapping documents:
<class
name="com.xxx.bean.Email"
table="EMAILS"
dynamic-update="true"
dynamic-insert="true"
>
<id
name="emailId"
type="long"
column="EMAIL_ID"
length="22"
>
<generator class="native"/>
</id>
<property
name="emailattachment"
column="EMAILATTACHMENT"
type="java.sql.Blob"
/>

Code between sessionFactory.openSession() and session.close():
byte[] buffer = new byte[1];
buffer[0] = 1;
email.setEmailattachment(Hibernate.createBlob(buffer));
Long id = (Long)session.save(email);
System.out.println("id " + id);

getHibernateTemplate().refresh(email, LockMode.UPGRADE); //error here..

Full stack trace of any exception that occurs:
java.sql.SQLException: ORA-01002: fetch out of sequence

Name and version of the database you are using:
Oracle 9i

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 29, 2004 10:17 am 
Senior
Senior

Joined: Tue Nov 25, 2003 9:35 am
Posts: 194
Location: San Francisco
Look at this:

http://forum.hibernate.org/viewtopic.php?t=931265&highlight=oracle+blob


Sherman


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.