-->
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.  [ 4 posts ] 
Author Message
 Post subject: exception by committing objects
PostPosted: Tue Sep 27, 2005 2:49 pm 
Newbie

Joined: Sun Dec 21, 2003 1:59 pm
Posts: 5
Hi Community,

I tried to insert two objects with nhibernate. All works fine when I insert the objects separately:
Code:
ISession s1 = OpenSession();
ITransaction t1 = s1.BeginTransaction();

s1.Save(createProcessDefinition());
s1.Save(createStartState());
t1.Commit();
s1.Close();


But then I added the Object startState to processDefiniton I got an exception by committing the session.

Code:
ISession s1 = OpenSession();
ITransaction t1 = s1.BeginTransaction();

ProcessDefinitionImpl process = createProcessDefinition();
process.StartState=createStartState();

s1.Save(process);

t1.Commit();
s1.Close();


The exception text:
SQL insert, update or delete failed (expected affected row count: 1, actual affected row count: 0). Possible causes: the row was modified or deleted by another user, or a trigger is reporting misleading row count.

Could this be a bug?

Regards
Philipp


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 28, 2005 1:27 pm 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
It looks like NHibernate issues an Update for your StartState; can you post your mapping? (make sure that you set the "unsaved-value"...)

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 28, 2005 1:39 pm 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
You may also read these posts:
- newbie: using one-to-many mapped classes
- Master/Detail error

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 30, 2005 12:22 pm 
Newbie

Joined: Sun Dec 21, 2003 1:59 pm
Posts: 5
Thank you for the great support.
Now all works fine.


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