NHibernate Oracle - Transaction Commit Issue?

This error is an integrity constraint error. It means that at the end of your transaction a child that has no parent in a parent-child relationship. Since you are getting this error on commit it means the FOREIGN KEY is declared as DEFERRABLE (initialy deferred) and only checks for integrity at commit time.

This error is an integrity constraint error. It means that at the end of your transaction a child that has no parent in a parent-child relationship. Since you are getting this error on commit it means the FOREIGN KEY is declared as DEFERRABLE (initialy deferred) and only checks for integrity at commit time.

You have a problem in your logic, perhaps you could post a simple example (CREATE TABLE parent... CREATE TABLE child... UPDATE/INSERT) and we can help you further.

Nbernate does the insert (or update) of your employee before inserting the newly created employee_type. The error means that your employee is missing its employee_type in database. 2 choices: Do a ISession.

Flush after creating the employee_type and before creating (or updateing) your employee. Change the foreign key to be deferable.

I got the solution .... It is happening with me because of N.. I have explicitely created Sequence and Triggers for autoincrement. But it will fire two time, first when I did normal save and second when I call transaction complete. So there is miss match between id's actual used and referenced.So it is giving me error - parent key not found.

I have just removed all the trigger and sequences and in the mapping file I have added generated class as a increment. :D " generator class="increment" " It is perfectly works for me... Thanks, Mahesh.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions