openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prashant Bhat <prashant...@gmail.com>
Subject Re: OpenJPA Date Proxy serialization problem when using entities with GWT
Date Thu, 24 Mar 2011 01:57:49 GMT
 I don't know much about the benefits of using proxies, but in our
particular usage, all proxies should be removed when the entity is
detached/serialized. Then we can use entities directly in GWT avoiding DTOs
and also with this, client side will not have dependency on OpenJPA at
runtime.

Regards,
Prashant

On Wed, Mar 23, 2011 at 9:22 PM, Michael Dick <michael.d.dick@gmail.com>wrote:

> I haven't had a chance to look at your example application, but I think we
> need to make some changes to the way we handle proxies.
>
> Currently there's no way to prevent proxies from being inserted. It's not
> intuitive when they will be inserted, and they can be tough to remove. What
> I'd propose is to make it work something like this :
>
> if openjpa.ProxyManager.TrackChanges == False :
>    # No proxies are inserted. Ever.
>
> else :
>
>    if openjpa.DetachState.DetachedStateField == "true":
>        # proxies are inserted when the entity is flushed (or committed)
>        # proxies are not removed when the entity is detached
>        # proxies are not removed when the entity is serialized
>
>   elif openjpa.DetachState.DetachedStateField == "transient" :
>        # proxies are inserted when the entity is flushed (or committed)
>        # proxies are not removed when the entity is detached
>        # proxies are removed when the entity is serialized
>
>    elif openjpa.DetachState.DetachedStateField == "false" :
>        # proxies are inserted when the entity is flushed (or committed)
>        # proxies are removed when the entity is detached
>        # proxies are removed when the entity is serialized
>
> From what I've seen none of these are accurate for trunk, and the related
> code path is a bit tangled (or I just haven't groked it).
>
> For your specific use case, would you want the proxies to ever be inserted?
>
> -mike
>
>

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