TomEE 7 and Hibernate 5.2 persistence.xml

Load all Hibernate jars and dependencies (exclude slfj 1.6) in tomee/libs folder, and use scope provided in pom.xml.

Property hibernate.temp.use_jdbc_metadata_defaults is set to false due to hibernate startup is slow with postgres in true.

Property “tomee.jpa.factory.lazy” is due Romain Manni-Buc forum statement:

You can disable cdi for hibernate tomee.jpa.cdi=false in the persistence
unit or system properties.

If you want it – was not part if 7.0.1 – you can in the same locations set
tomee.jpa.factory.lazy to true.

Idea is to let hibernate initialize ince cdi is started but let cdi have
jpa entity manager or factory – yes chicken egg problem but spec is written
this way ;).


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s