openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dianne Richards (JIRA)" <>
Subject [jira] Commented: (OPENJPA-885) Support clear methods on EntityManager, including new CascadeType.CLEAR
Date Fri, 06 Mar 2009 17:03:56 GMT


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

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

   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:
>             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.

View raw message