Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Hi,
I have 2 tables with one-to-many association.When I do an insert into the one table I get the ID of it and do an insert into the many table that Id and other values for the many table.
If I get an exception while inserting in the many table the one table is not getting rolled back.I need to put this unit of work in a transaction.
My question is how do i do this in a transaction.I know with hibernate you have begin and end transaction.I am using spring with hibernate and calling hibernate methods using getHibernateTemplate() method.
Can anyone help me ??