I'm sharing a single Connection to a file instance of H2 with auto-commit set to false in embedded mode. Everything seems to work fine and I make sure to call connection.commit() after doing any work. However, frequently, I'm finding that when I stop the database and start it back up, data sometimes doesn't actually get persisted to the file and it starts back up saying that table is empty.
Is there anything I can do to guarantee everything is properly synchronized to the database file?
I've tried adding a shutdown hook to make sure commit is run and the connection is closed, but that doesn't seem to make much difference.