Hi All,
I am using Hibernate 2.1.6, In that to do batch insert, I retrive a new session each time for a TO and do the insert as below
for (Iterator iter = baseTos.iterator(); iter.hasNext();) {
to = (BaseTo) iter.next();
getSession().save(to);
}
Can I change this code to
Session ses = getSession();
for (Iterator iter = baseTos.iterator(); iter.hasNext();) {
to = (BaseTo) iter.next();
ses.save(to);
}
Basically Instead of getting new session for each save, I am using the existing session. What happens if one of the save fails??.
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: