dazey3 commented on a change in pull request #82:
URL: https://github.com/apache/openjpa/pull/82#discussion_r732198727



##########
File path: 
openjpa-persistence/src/main/java/org/apache/openjpa/persistence/JPAProperties.java
##########
@@ -29,6 +29,8 @@
 import org.apache.openjpa.kernel.DataCacheStoreMode;
 import org.apache.openjpa.lib.util.StringUtil;
 
+import serp.util.Strings;

Review comment:
       From my debugging, the way persistence.xml properties/values are 
processed is by iterating over the whole list of properties to find those that 
match (See org.apache.openjpa.lib.conf.ConfigurationImpl._vals & 
org.apache.openjpa.lib.conf.ConfigurationImpl.fromProperties(Map map))
   
   I attempted to look into integrating this logic into 
EntityManager.setProperty(), because ConfigurationImpl has all the logic for 
default values, ranges, conversion, ect! It looked good, but was ultimately 
terrible in performance because it required iterating over 
`org.apache.openjpa.lib.conf.ConfigurationImpl._vals` to find the property 
being set. Then, you cant actually change the value because ConfigurationImpl 
is at the EMF level, not the EM level. 
   
   Anyway, the current implementation just uses reflection and assumes the 
values are correct. Not the best implementation compared to ConfigurationImpl, 
but I didn't feel like rewriting this whole implementation! I think this 
ConfigurationImpl utility could be extracted out to its own utility for 
property verification and conversion. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@openjpa.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to