Skip to content

Commit 0b9f5dc

Browse files
gsmetSanne
authored andcommitted
HHH-14317 Avoid closing datasource in AgroalConnectionProvider if datasource is not initialized
1 parent 358fc58 commit 0b9f5dc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hibernate-agroal/src/main/java/org/hibernate/agroal/internal/AgroalConnectionProvider.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ public <T> T unwrap(Class<T> unwrapType) {
139139

140140
@Override
141141
public void stop() {
142-
agroalDataSource.close();
142+
if ( agroalDataSource != null ) {
143+
agroalDataSource.close();
144+
}
143145
}
144146
}

0 commit comments

Comments
 (0)