Hi, I have a class to manage the hibernate session and everything was going ok until i had an exception and the rollback didn't work. Let me explain my application: I have a table Person that is related with PhonesNumber table in a one-to-many relationship (using annotations)
If I make an insertion of a person with phone numbers and for example the phone number is null, it would return an exception on the data base. My problem is that the table phone numbers don't insert anything because of the error and it is ok but after the rollback is executed the table Person has the new register. As a result my data base gets dirty.
|