openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <ppod...@apache.org>
Subject Re: Speeding up commit
Date Tue, 14 Jun 2011 20:32:02 GMT
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 
--
View this message in context: http://openjpa.208410.n2.nabble.com/Speeding-up-commit-tp6474341p6475817.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message