I have written a set of unit tests using H2 in embedded mode. Whatever changes tests make to DB stay there.
I know that the recommended approach is to create a blank in-memory database and create the schema when opening the connection.
However I am looking for an alternative approach. I would like to -
- Initialize an in memory database with an embedded database file.
- Or use embedded db in a way that all the changes are discarded as soon as the connection is closed.
How can I achieve this?