mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-12 14:14:49 +00:00
HHH-13525 Make test SessionDelegatorBaseImplTest more resilient to previously existing alias definition
(cherry picked from commit d6abbe51243b13fa104848bed853034884f574ed)
This commit is contained in:
parent
81d7be0ad3
commit
3dbf0166fe
@ -29,6 +29,7 @@ public void init() {
|
||||
inTransaction( session -> {
|
||||
session.doWork( connection -> {
|
||||
try (Statement statement = connection.createStatement()) {
|
||||
statement.executeUpdate( "DROP ALIAS findOneUser IF EXISTS" );
|
||||
statement.executeUpdate(
|
||||
"CREATE ALIAS findOneUser AS $$\n" +
|
||||
"import org.h2.tools.SimpleResultSet;\n" +
|
||||
@ -55,7 +56,9 @@ public void tearDown() {
|
||||
try (Statement statement = connection.createStatement()) {
|
||||
statement.executeUpdate( "DROP ALIAS findOneUser IF EXISTS" );
|
||||
}
|
||||
catch (SQLException ignore) {
|
||||
catch (SQLException e) {
|
||||
//Do not ignore as failure to cleanup might lead to other tests to fail:
|
||||
throw new RuntimeException( e );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
Loading…
x
Reference in New Issue
Block a user