-->
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: Another syncronization problem
PostPosted: Mon May 17, 2004 8:38 pm 
Newbie

Joined: Mon May 17, 2004 8:25 pm
Posts: 2
Upon trying to save cascaded entries, I'm getting the same exception that a lot of people have complained about:

Quote:
17:22:09,329 ERROR SessionImpl:2343 - Could not synchronize database state with session
net.sf.hibernate.HibernateException: SQL insert, update or delete failed (row not found)


Except I actually read through the faqs and searched the forums. I've added unsaved-value="null" to all my classes, but I still get the same problem. The only way I can avoid this problem is by ensuring that the set containing the cascaded data is empty.

I would like to stress that I am not updating nor deleting. The following java code is all I am doing(Each Order object contains a set of OrderItem objects):

Code:
Order o = createOrder();
Session session = null;
Transaction tx = null;
try
{
   session = sf.openSession();
}
catch( PersistenceException pe )
{
   throw new RuntimeException( "* ERROR openening session." );
}
try
{
   tx = session.beginTransaction();
   session.save( o );
   tx.commit();
}
catch( PersistenceException pe )
// and so on.......


If I just try saving the OrderItems that are within o, I get no exception.

Any ideas?

Thank you for your time.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 18, 2004 2:18 pm 
Newbie

Joined: Mon May 17, 2004 8:25 pm
Posts: 2
Never mind, I figured it out. It had to do with generating IDs versus assigning them.

Thanks


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.