I have the following property in my persistence.xml:
<property name="openjpa.ConnectionProperties" value="DriverClassName=com.mysql.jdbc.Driver,jdbcUrl=jdbc:mysql://localhost:3306/c,user=foo,password=foo,autocommit=false,automaticTestTable=testtable,idleConnectionTestPeriod=60"/>
I am trying to override it using a system property according to docs , so I have a set:
-Dopenjpa.ConnectionProperties=DriverClassName=com.mysql.jdbc.Driver,jdbcUrl=jdbc:mysql://localhost:3306/bar,user=bar,password=bar,autocommit=false,automaticTestTable=testtable,idleConnectionTestPeriod=60
But this does not work : OpenJPA always reads the property value from persistence.xml
Only when the property in persistence.xml is removed does it read the value from the system property.
Is this the expected behavior, and if so, what is the correct way to override a property from persistence.xml?
Joel source share