Quote:
I'm not sure what's going on, but it performs the first insert perfectly, then on the next insert I get a "net.sf.hibernate.HibernateException: Session is currently disconnected"
Then when trying to commit, I get ...
I do not understand how do you arrive to commit() if you are getting exception on second insert (second session.save() or what?). In the case of Hibernate exception you should immediately leave try block so you just can not perform commit().
To be honest I have no idea why this code may fail (unless you are doing some BAD THINGS with interceprors / custom persisters or other "advenced" stuff).
Do I understand correctly what code you shown here being the only content of "main" method (except for session factory preparation of course) causes this exception? Could you paste debug log here?