Specifying `javax.persistence.schema-generation.database.action` in `persistence.xml` causes redeployment on Payara 5.182 to fail due to `java.lang.IllegalStateException: This web container has not yet been started`. This happens during the second deployment only in 100% of cases. Example stacktrace (with Derby):
I reported this issue to Payara at https://github.com/payara/Payara/issues/2894 with a PostgreSQL-based SSCCE and the assigned dev is sure that it's a Hibernate or PostgreSQL issue caused by incorrect reusage a classloader (see Payara issue for details). I ruled out PostgreSQL because the issue happens with Apache Derby as well.
An SSCCE is provided at https://gitlab.com/krichter/netbeans-java-ee-double-deployment (don't be confused by the name) with the reproductions of the issue on the branches master (PostgreSQL-based connection), hibernate-update (latest 6.0.0-SNAPSHOT), apache-derby (Apache Derby-based connection) and fix (showing that removal of the property from `persistence.xml` fixes the issue. The detailed logs can be investigated via the GitLab CI results available under CI/CD->Pipelines.