Hi Henry,
I solved the problem with H2 database by adding the DB_CLOSE_DELAY option to the connection URL: jdbc:h2:mem:myapp_test;
DB_CLOSE_DELAY=10I was able to run PIT 5 times in a row now without problems.
I'll add more details because it might be helpful for other similar problems:
My test suite is fully deterministic, I can run it 1000 times with Maven or my IDE and it will never fail, no matter if I run the full suite or any subset. It would only fail with PIT, always with the same missing table error.
For my test suite, the database is created only once at the beginning, together with the Spring Context/Session Factory by setting the property "hibernate.hbm2ddl.auto" to "create", and it is never closed programmatically.
From the H2 website: "Usually, a database is closed when the last connection to it is closed" (when the close delay option is not used).
I have another issue now, I guess I'm pushing PIT to its limits :)
I'll do a bit of research and if needed, create a different topic for it.
Cheers,
Eduardo.