Hi!
I'm new to hibernate and just wrote myself a little test application. It nearly works, i can read data out of the db and save changes, but when i try to insert a new data, I get this error when doing the commit:
Code:
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
I'm sure the problem has to do with my identifier, but can't figure out what's wrong.
Code:
<id name="Id" column="PERSONID" type="Int32">
<generator class="assigned" />
</id>
In the class and the db (oracle) it is an integer. I use this to save or update the values:
Code:
public void savePerson(Person pers)
{
ISession session = factory.OpenSession();
ITransaction tx = session.BeginTransaction();
session.SaveOrUpdate(pers);
tx.Commit();
session.Close();
Works perfectly for an update, but sucks for the "insert". Does anybody have an idea where my mistake is?
Thanks for any help,
Martin