[ 
https://issues.apache.org/jira/browse/OPENJPA-885?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679653#action_12679653
 ] 

Dianne Richards commented on OPENJPA-885:
-----------------------------------------

In testing the new function in this JIRA, I've run into a problem that I could 
use some input for. First, let me explain what I'm doing. There are 4 
compatibility options (identified in a previous post). We need to change the 
default values for openjpa only, without affecting other derived products. So, 
I've put code in the PersistentProductDerivation to retrieve the Compatibility 
instance and set the new default values for openjpa.

In my unit test, I initially changed these individual values in my test code, 
by retrieving the Compatibility instance and using the appropriate setter 
method, and things worked fine. But, when I specified a change using a 
property, ex: openjpa.Compatibility=default(flushBeforeDetach=false), the other 
3 default values reverted to the original values, not the ones that I set in 
the PPD.

Here's what I discovered through running the debugger: THe 
OpenJpaConfigurationImpl.fromProperties() is called to store the new 
properties. this calls PluginValue.setString(). This has the following code:

   if (_singleton)
      set(null, true)

which effectively changes the _value from the current Compatibility object to 
null. Thus, when the next getCompatibilityInstance() method is called, a new 
object is instantiated, with the original default values. Is this a bug? Are 
there other properties that this could happen to in the future? ANy suggestions 
on how to fix this without breaking things?

> Support clear methods on EntityManager, including new CascadeType.CLEAR 
> ------------------------------------------------------------------------
>
>                 Key: OPENJPA-885
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-885
>             Project: OpenJPA
>          Issue Type: Sub-task
>    Affects Versions: 2.0.0
>            Reporter: Dianne Richards
>            Assignee: Dianne Richards
>             Fix For: 2.0.0
>
>         Attachments: patch.txt
>
>
> Support the 2.0 new  EntityManager clear() methods. Also support the new 
> CascadeType.CLEAR.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to