openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <curti...@gmail.com>
Subject Re: [External] Re: OpenJPA Null Update
Date Fri, 14 Jun 2013 13:44:47 GMT
You could set the property openjpa.DetachState(DetachedStateField=true). This
property will make our DetachedStateManager serializeable and then the JPA
runtime can 'track' a detached Entity. The only down side to this approach
is that the OpenJPA classes must be on the classpath of the client that
your Entities are being streamed to. I'll also note that this property is
important to be set prior to enhancement because it changes our enhanced
bytecode.

Let me know how it goes.

Thanks,
Rick

[1]
http://ci.apache.org/projects/openjpa/trunk/docbook/manual.html#ref_guide_detach_graph


On Fri, Jun 14, 2013 at 1:37 AM, Boblitz John <john.boblitz@bertschi.com>wrote:

> Hello,
>
> I think that Chapter 12.1.2 in the Manual will help here.
>
> "When attaching null fields in these cases, OpenJPA cannot distinguish
> between a field that was unloaded and one that was
> intentionally set to null. In this case, OpenJPA will use the current
> detach state setting to determine how to handle null fields:
> fields that would have been included in the detached state are treated as
> loaded, and will in turn set the corresponding attached
> field to null."
>
> Regards,
> John
>
>
> > -----Original Message-----
> > From: Tibebu, Nebiyou [USA] [mailto:Tibebu_Nebiyou@bah.com]
> > Sent: Friday, June 14, 2013 5:26 AM
> > To: users@openjpa.apache.org
> > Subject: RE: [External] Re: OpenJPA Null Update
> >
> > Rick,
> >
> > Thank you for your help. Here is the scenario:
> >
> > 1. Get a persistent instance of an entity 2. Detach entity 3. Update
> values on
> > the entity with non-null values 4. One of these values will be a string
> value
> > with existing non-trivial data 5. Set the value on this field to null 6.
> Merge
> > entity 7. All other fields are updated except this value.
> >
> > Nebiyou Tibebu
> > ________________
> > Booz | Allen | Hamilton
> > 8283 Greensboro Dr, Mclean, VA 22102
> > tibebu_nebiyou@bah.com
> > ________________________________________
> > From: Rick Curtis [curtisr7@gmail.com]
> > Sent: Thursday, June 13, 2013 10:31 PM
> > To: users@openjpa.apache.org
> > Subject: RE: [External] Re: OpenJPA Null Update
> >
> > Well, you are going to have to describe what your scenario is for any of
> us to
> > help you out.
> > On Jun 13, 2013 6:57 PM, "Tibebu, Nebiyou [USA]"
> > <Tibebu_Nebiyou@bah.com>
> > wrote:
> >
> > > I am not getting any errors. It is just being ignored.
> > >
> > > Nebiyou Tibebu
> > > ________________
> > > Booz | Allen | Hamilton
> > > 8283 Greensboro Dr, Mclean, VA 22102
> > > tibebu_nebiyou@bah.com
> > > ________________________________________
> > > From: Tibebu, Nebiyou [USA]
> > > Sent: Thursday, June 13, 2013 5:55 PM
> > > To: users@openjpa.apache.org
> > > Subject: RE: [External]  Re: OpenJPA Null Update
> > >
> > > Nebiyou Tibebu
> > > ________________
> > > Booz | Allen | Hamilton
> > > 8283 Greensboro Dr, Mclean, VA 22102
> > > tibebu_nebiyou@bah.com
> > > ________________________________________
> > > From: Rick Curtis [curtisr7@gmail.com]
> > > Sent: Thursday, June 13, 2013 5:12 PM
> > > To: users
> > > Subject: [External]  Re: OpenJPA Null Update
> > >
> > > Are you getting an error or something... or is it just being ignored?
> > > If it is being ignored, can you better describe the scenario that
> > > you're running?
> > >
> > >
> > > On Thu, Jun 13, 2013 at 3:00 PM, Tibebu, Nebiyou [USA] <
> > > Tibebu_Nebiyou@bah.com<mailto:Tibebu_Nebiyou@bah.com>> wrote:
> > > I am unable to update Nullable VARCHAR columns in Mainframe DB2 to
> > NULL.
> > > Update to other values, including an empty string works fine. I would
> > > appreciate some assistance. This is in version 2.2.1.
> > >
> > > Nebiyou Tibebu
> > > Senior Consultant
> > > 13200 Woodland Park Rd,
> > > Herndon, VA 21071
> > > Email: tibebu_nebiyou@bah.com<mailto:tibebu_nebiyou@bah.com>
> > > Tel: (703) 377-5425<tel:%28703%29%20377-5425>
> > > Cell: (571) 422-5178<tel:%28571%29%20422-5178>
> > >
> > >
> > [http://www.soaschool.com/system/application/images/soacp_architect.jp
> > > g]
> > >
> > > Booz  Allen  Hamilton |
> > > http://www.boozallen.com<http://www.boozallen.com/
> > > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > Rick Curtis
> > >
>



-- 
*Rick Curtis*

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message