[hibernate-commits] Hibernate SVN: r16246 - annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/generics.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Tue Mar 31 18:07:08 EDT 2009


Author: gbadner
Date: 2009-03-31 18:07:07 -0400 (Tue, 31 Mar 2009)
New Revision: 16246

Modified:
   annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/generics/EmbeddedGenericsTest.java
Log:
JBPAPP-1852 ANN-778 - Test hangs if an exception is thrown, due to unclosed transaction


Modified: annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/generics/EmbeddedGenericsTest.java
===================================================================
--- annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/generics/EmbeddedGenericsTest.java	2009-03-31 21:28:23 UTC (rev 16245)
+++ annotations/branches/v3_3_1_GA_CP/src/test/org/hibernate/test/annotations/generics/EmbeddedGenericsTest.java	2009-03-31 22:07:07 UTC (rev 16246)
@@ -28,17 +28,12 @@
 
 	public void setUp() throws Exception {
 		super.setUp();
-		session = getSessions().openSession();
+		session = openSession();
 		session.getTransaction().begin();
 		edition = new Edition<String>();
 		edition.name = "Second";
 	}
 
-	public void tearDown() throws Exception {
-		session.close();
-		super.tearDown();
-	}
-
 	public void testWorksWithGenericEmbedded() {
 		Book b = new Book();
 		b.edition = edition;
@@ -48,6 +43,7 @@
 		assertEquals( "Second", retrieved.edition.name );
 		
 		clean( Book.class, b.id );
+		session.close();
 	}
 
 	public void testWorksWithGenericCollectionOfElements() {
@@ -59,6 +55,7 @@
 		assertEquals( "Second", retrieved.editions.iterator().next().name );
 
 		clean( PopularBook.class, b.id );
+		session.close();
 	}
 
 	protected Class[] getMappings() {




More information about the hibernate-commits mailing list