NHibernate.AssertionFailure: null id in entry (don't flush the Session after an exception occurs)
I got this NHibernate exception:
NHibernate.AssertionFailure: null id in entry (don't flush the Session after an exception occurs)
To be honest I don't know what it means. I don't think I'm flushing the session anywhere, but I have the feeling that the problem is something else.
Anyone knows what it might be?
theDude
Status:
Open Oct 20, 2006 - 11:50 AM
NHibernate, C#, web development
4answers
Answers
Jan 05, 2007 - 06:59 AM
What were you doing when you got this?
Jan 06, 2007 - 05:28 AM
it happened a while back and I'm not sure what made it happen :-/
I think it was a problem of an id column in the database not being auto-numeric.
Jan 06, 2007 - 05:57 AM
Always try the auto hbm2dll.auto feature of nhibernate to check how the generated tables look like.
You can acomplish that in nhibernate configuration:
key="hibernate.hbm2ddl.auto"
value="create"
/>
(don't forget to change the db location, or you'll fubar your current db)
Jan 06, 2007 - 08:34 AM
oh, great, didn't know about that.
You get the points for that...
Answer this question
Share Your Own Experience & Expertise
We look to ensure that every question is answered by the best people with relevant expertise and experience, the best answers include multiple perspectives. Do you have relevant expertise or experience to contribute your answer to any of these commonly asked questions?
Add New Comment