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:
|
|