matrei commented on code in PR #15453:
URL: https://github.com/apache/grails-core/pull/15453#discussion_r2853444157
##########
grails-testing-support-dbcleanup-h2/src/main/groovy/org/apache/grails/testing/cleanup/h2/H2DatabaseCleaner.groovy:
##########
@@ -57,53 +55,36 @@ class H2DatabaseCleaner implements DatabaseCleaner {
@Override
boolean supports(DataSource dataSource) {
- Connection connection = null
- try {
- connection = dataSource.getConnection()
- DatabaseMetaData metaData = connection.getMetaData()
- String url = metaData.getURL()
- return url && url.startsWith('jdbc:h2:')
- }
- catch (Exception e) {
+ try (def con = dataSource.connection) {
Review Comment:
No, seems to work!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]