Skip to content

Commit 0cbf0e5

Browse files
committed
Minor improvement to the previous backport commit
Signed-off-by: Jan Schatteman <[email protected]>
1 parent 0af8755 commit 0cbf0e5

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithManyToMany_HHH_11302_Test.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ protected void buildSessionFactory() {
6161
"@OneToMany, @ManyToMany or @ElementCollection cannot be used inside an @Embeddable that is also contained within an @ElementCollection"
6262
) );
6363
}
64+
finally {
65+
if ( serviceRegistry() != null ) {
66+
serviceRegistry().destroy();
67+
}
68+
}
6469
}
6570

6671
@Test

hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_11302_Test.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ protected void buildSessionFactory() {
6161
"@OneToMany, @ManyToMany or @ElementCollection cannot be used inside an @Embeddable that is also contained within an @ElementCollection"
6262
) );
6363
}
64+
finally {
65+
if ( serviceRegistry() != null ) {
66+
serviceRegistry().destroy();
67+
}
68+
}
6469
}
6570

6671
@Test

hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_8564_Test.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ protected void buildSessionFactory() {
5555
"@OneToMany, @ManyToMany or @ElementCollection cannot be used inside an @Embeddable that is also contained within an @ElementCollection"
5656
) );
5757
}
58+
finally {
59+
if ( serviceRegistry() != null ) {
60+
serviceRegistry().destroy();
61+
}
62+
}
5863
}
5964

6065
@Test

hibernate-core/src/test/java/org/hibernate/test/annotations/embeddables/collection/EmbeddableWithOneToMany_HHH_8860_Test.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ protected void buildSessionFactory() {
5353
"@OneToMany, @ManyToMany or @ElementCollection cannot be used inside an @Embeddable that is also contained within an @ElementCollection"
5454
) );
5555
}
56+
finally {
57+
if ( serviceRegistry() != null ) {
58+
serviceRegistry().destroy();
59+
}
60+
}
5661
}
5762

5863
@Test

0 commit comments

Comments
 (0)