openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <curti...@gmail.com>
Subject Re: Speeding up commit
Date Tue, 14 Jun 2011 20:49:16 GMT
Is the problem when OpenJPA tries to proxy user supplied objects on
transaction commit(flush)? Or is the problem when the persistence context
detaches and OpenJPA spends cycles trying to remove the proxies that we just
put in?

Pinaki - Did you solve the both problems, or just the second? ... I thought
the user Aron was reporting a problem with the fact that we ever put proxies
in.?

On Tue, Jun 14, 2011 at 3:32 PM, Pinaki Poddar <ppoddar@apache.org> wrote:

> Hello,
>  For batch insertion,
>  1. Set openjpa.RetainState=false
>  this might gain few extra cycles
>
>  I had introduced a tentative option [1] for automatic detachment (your
> observation of cycles being spent on StateManager.proxyFields(...) is
> related to detachment process that OpenJPA runtime invokes at
> user-configurable points in the lifetime of a persistence context such as
> transaction endpoints or when EntityManager.close() is called).
>
>  If the user application does not intend to refer to the managed entities
> later (as it seems to fits the use case you are describing), then we can
> bypass the overhead of detachment.
>
>  In a quick Person-has-many-Address type model, I notice a ~20% reduction
> in data insert with this new NONE option.
>
>  To access, and if possible verify efficacy of this new feature, please do
> the following
>
> 1. get a nightly build or build from trunk locally.
> 2. Ensure that  revision 1135776 is included. Easy way to do this
>    $ java -jar openjpa.jar
>   will print the latest revision included in the jar
> 3. In user application,
>      em.setProperty("openjpa.AutoDetach", AutoDetachType.NONE);
>    Note that the option must be set on an instantiated EntityManager, and
> *not* in persistence.xml
>
> [1] https://issues.apache.org/jira/browse/OPENJPA-2017
>
> -----
> Pinaki
>
> --
*Rick Curtis*

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