[hibernate-commits] Hibernate SVN: r10662 - branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x
hibernate-commits at lists.jboss.org
hibernate-commits at lists.jboss.org
Tue Oct 31 08:21:54 EST 2006
Author: max.andersen at jboss.com
Date: 2006-10-31 08:21:53 -0500 (Tue, 31 Oct 2006)
New Revision: 10662
Modified:
branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/QueryExporter.java
Log:
tx exceptions not properly handled
Modified: branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/QueryExporter.java
===================================================================
--- branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/QueryExporter.java 2006-10-31 02:19:13 UTC (rev 10661)
+++ branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/tool/hbm2x/QueryExporter.java 2006-10-31 13:21:53 UTC (rev 10662)
@@ -61,11 +61,19 @@
}
transaction.commit();
} catch(HibernateException he) {
- if(transaction!=null) transaction.rollback();
+ if(transaction!=null) {
+ transaction.rollback();
+ }
+ throw new ExporterException("Error occured while trying to execute query", he);
} finally {
- session.close();
- session.getSessionFactory().close();
+ if(session!=null) {
+ session.close();
+ }
+ if(sessionFactory!=null) {
+ sessionFactory.close();
+ }
+
}
}
More information about the hibernate-commits
mailing list