WFLY-19020: behavior change in persistence unit handling of application client
by Wolfgang Knauf
Hi all,
this question is about a change in the way that a JakartaEE application
client is launched: https://issues.redhat.com/browse/WFLY-19020
Before the change, an application client might receive a
ClassNotFoundException because of a missing hibernate class. My
workaround for this was to add jboss-deployment-structure.xml and
include the module "org.hibernate".
This behavior was changed in 31.0.1 after my bugreport: it seems the
application client deploys "persistence.xml" from the EJB jar somehow,
and my sample now works.
But this change also causes the application client to create/drop the
tables each time it is launched if persistence.xml defines
"hibernate.hbm2ddl.auto=create-drop". This did not happen with WildFly
31.0.0 and before.
It can be avoided if the data source in "appclient.xml" points to a H2
memory database instead of the real database defined in "standalone.xml".
I did not verify whether old WildFly versions required the datasource to
be defined in "appclient.xml", but I have the feeling that it was necessary.
Currently, this is only an unnecessary step. But if the datasource
defined in "appclient.xml" would point to the "real" datasource defined
in "standalone.xml", the tables would be created each time the client
starts. Fortunately, I could not make it work to define a MariaDB
connection in "appclient.xml" because it could not resolve the driver,
but with some effort this could be possible.
What do you think about this change? To me, it sounds unnecessary to
create/drop tables from EJB "persistence.xml" when an app client is
started. Is it required if the app client itself would use client side JPA?
Best regards
Wolfgang
3 days, 5 hours
WildFly 32 is released!
by Brian Stansberry
Thank you, everyone, for your great work on WildFly 32, which is now live
on wildfly.org! The WildFly Glow tooling has also had its 1.0 Final
release, which is a major step forward for the WildFly ecosystem.
Have a look at https://www.wildfly.org/news/2024/04/25/WildFly32-Released/
to get a sense of all the things we've been doing.
I want to give a special shout-out to Prarthona Paul, who was a real hero
this release for all the work she did on bringing in new features using the
new stability levels. She was a major pioneer, identifying working through
so many of the pain points. She was also a major force behind a lot of our
recent community engagement activities like the user guides and the mini
conference. You are a rock star, Prarthona!
Best regards,
--
Brian Stansberry
Principal Architect, Red Hat JBoss EAP
WildFly Project Lead
He/Him/His
4 days, 7 hours