I'm running some functional tests where I restore the database to a clean state in between tests. Unfortunately the restore command for SQL Server requires there be no other connections to the database. Is there a way I can call some test code to disconnect Grails/GORM and then reconnect once the database restore has completed?
I had the database restore code bring the database offline, do the restore, then bring the database back online.
Adding
properties:
testOnBorrow: true
testWhileIdle: true
testOnReturn: false
validationQuery: SELECT 1
to the database setup fixed the issue by having the database reconnect automatically.