-->
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.  [ 3 posts ] 
Author Message
 Post subject: StaleObjectStateException, jboss, Oracle
PostPosted: Thu Jan 15, 2004 5:19 am 
Newbie

Joined: Thu Jan 15, 2004 5:04 am
Posts: 6
Hi,
I'm using Hibernate 2.1.1, JBoss 3.2.3 and Oracle 8.1.7.
I execute following code in session EJB method

Code:
Category category = (Category) session.load(Category.class,categoryOid);   

suggestion = new Suggestion();
category.addSuggestion(suggestion);
      
Comment comment = new Comment();
suggestion.addComment(comment);           

session.flush();


and get StaleObjectStateException in last line (flush method).
I'm the only user of this db so I don't understand the reason for this exception.

Hibernate log is

Quote:
[net.sf.hibernate.impl.SessionImpl] executing flush
[net.sf.hibernate.persister.EntityPersister] Inserting entity: [com.valuecommerce.sbox.hibernate.Suggestion#47]
[net.sf.hibernate.persister.EntityPersister] Version: 2004-01-14 15:16:04.974
[net.sf.hibernate.impl.BatcherImpl] about to open: 0 open PreparedStatements, 0 open ResultSets
[net.sf.hibernate.SQL] insert into SB_SUGGESTION (INS_DATE, CATEGORY_OID, OID) values (?, ?, ?)
[net.sf.hibernate.impl.BatcherImpl] preparing statement
[net.sf.hibernate.persister.EntityPersister] Dehydrating entity: [com.valuecommerce.sbox.hibernate.Suggestion#47]
[net.sf.hibernate.type.TimestampType] binding '14 January 2004 15:16:04' to parameter: 1
[net.sf.hibernate.type.LongType] binding '10' to parameter: 2
[net.sf.hibernate.type.LongType] binding '47' to parameter: 3
[net.sf.hibernate.impl.BatcherImpl] Adding to batch
[net.sf.hibernate.persister.EntityPersister] Inserting entity: [com.valuecommerce.sbox.hibernate.Comment#61]
[net.sf.hibernate.persister.EntityPersister] Version: 2004-01-14 15:16:05.024
[net.sf.hibernate.impl.BatcherImpl] Executing batch size: 1
[net.sf.hibernate.impl.BatcherImpl] success of batch update unknown: 0

[net.sf.hibernate.impl.BatcherImpl] done closing: 0 open PreparedStatements, 0 open ResultSets
[net.sf.hibernate.impl.BatcherImpl] closing statement
[net.sf.hibernate.impl.BatcherImpl] about to open: 0 open PreparedStatements, 0 open ResultSets
[net.sf.hibernate.SQL] insert into SB_COMMENT (INS_DATE, SUGGESTION_OID, OID) values (?, ?, ?)
[net.sf.hibernate.impl.BatcherImpl] preparing statement
[net.sf.hibernate.persister.EntityPersister] Dehydrating entity: [com.valuecommerce.sbox.hibernate.Comment#61]
[net.sf.hibernate.type.TimestampType] binding '14 January 2004 15:16:05' to parameter: 1
[net.sf.hibernate.type.LongType] binding '47' to parameter: 2
[net.sf.hibernate.type.LongType] binding '61' to parameter: 3
[net.sf.hibernate.impl.BatcherImpl] Adding to batch
[net.sf.hibernate.impl.BatcherImpl] Executing batch size: 1
[net.sf.hibernate.impl.BatcherImpl] success of batch update unknown: 0
[net.sf.hibernate.impl.BatcherImpl] done closing: 0 open PreparedStatements, 0 open ResultSets
[net.sf.hibernate.impl.BatcherImpl] closing statement
[net.sf.hibernate.persister.EntityPersister] Updating entity: [com.valuecommerce.sbox.hibernate.Suggestion#47]
[net.sf.hibernate.persister.EntityPersister] Existing version: 2004-01-14 15:16:04.974 -> New version: 2004-01-14 15:16:05.076
[net.sf.hibernate.impl.BatcherImpl] about to open: 0 open PreparedStatements, 0 open ResultSets
[net.sf.hibernate.SQL] update SB_SUGGESTION set INS_DATE=?, CATEGORY_OID=? where OID=? and INS_DATE=?
[net.sf.hibernate.impl.BatcherImpl] preparing statement
[net.sf.hibernate.persister.EntityPersister] Dehydrating entity: [com.valuecommerce.sbox.hibernate.Suggestion#47]
[net.sf.hibernate.type.TimestampType] binding '14 January 2004 15:16:05' to parameter: 1
[net.sf.hibernate.type.LongType] binding '10' to parameter: 2
[net.sf.hibernate.type.LongType] binding '47' to parameter: 3
[net.sf.hibernate.type.TimestampType] binding '14 January 2004 15:16:04' to parameter: 4
[net.sf.hibernate.StaleObjectStateException] An operation failed due to stale data


Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 15, 2004 5:39 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Might be the problem mentioned here:

http://www.hibernate.org/Documentation/ ... dDatabases


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 15, 2004 6:25 am 
Newbie

Joined: Thu Jan 15, 2004 5:04 am
Posts: 6
Replacement of Oracle 9 driver for Oracle 8 one helped.
Thanks a lot.


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