Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glassfish embedded: Database schema is NOT recreated as configured in peristence.xml #71

Open
hantsy opened this issue Feb 8, 2021 · 0 comments

Comments

@hantsy
Copy link
Member

hantsy commented Feb 8, 2021

I have set drop-and-create as database action properties in the persistence.xml.

<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>

When running the tests, it is ok on Glassfish managed, but failed on embedded due to a transaction exception(duplicated primary key insertion). I researched the logging and I think it is caused by the embedded database in Glassfish embedded. It was not recreated as expected when deploying test arcihve, but the runtime persistence context was cleaned.

I have to do an extra manual clean in the @Before hooks to overcome this issue.

hantsy/jakartaee8-starter-boilerplate#111

@hantsy hantsy changed the title Glassfish embedded: Database is not drop and recreated as configured in peristence.xml Glassfish embedded: Database is NOT recreated as configured in peristence.xml Feb 8, 2021
@hantsy hantsy changed the title Glassfish embedded: Database is NOT recreated as configured in peristence.xml Glassfish embedded: Database schema is NOT recreated as configured in peristence.xml Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant