Hi is_maximum, The results you are experiencing are atypical. Normally, when the Entity classes are enhanced, OpenJPA's performance is one of or the best, depending on the specific benchmark. Let's start with a few questions to see if we can narrow in on the problem.
o First off, you mention the enhancer. How are you invoking the enhancer? Are you statically pre-enhancing the Entity classes? Or, are you using the -javaagent jvm parameter? Or, are you relying on the Container classloader integration? I see that you are using the Sun Application Server, but are you relying on the container-managed persistence or are you using application-managed persistence? o The methods that you mention below are very minor, from a processing viewpoint. So, I really don't think the slow-down is due to enhancement. o Are your Entities "versioned"? That is, are you using an @Version field in your Entities? Due to the optimistic locking that JPA does by default, determining whether a given Entity is different from the database contents is much, much more efficient if we can just check the @Version field instead of comparing all of the individual fields. o Are you using Lazy or Eager fetching of attributes and relationships? Depending on the type of the attribute and/or relationship, the default fetch type may be different. For example, if you have a relationship defined as having a Lazy fetch type, but you are constantly accessed the contents of that relationship, then instead of waiting until you touch that relationship to get the contents from the database (lazy), you should probably change that to eager to allow us to get the data on the first trip to the database. The default values for the fetch type are meant to fit the 80/20 rule, but depending on your application, they may not fit your needs. o I see in your persistence.xml that you have turned off statement batching for your Oracle database. That's kind of surprising since under normal circumstances, statement batching can only help your performance concerns. Unless you are hitting some condition that forced you to turn it off? o And, turning on the data cache should also help, not cause you to go backwards. You do mention that you are using the 1.2.0 release. Have you tried moving to a later revision in the 1.2.x service stream? Or, even the 1.3.x branch? Just to help narrow down whether something has already been discovered and resolved for your environment. Let's start with that and see where these questions and answers take us. Kevin On Wed, Jan 28, 2009 at 7:41 AM, is_maximum <[email protected]> wrote: > > Hi > > We have a big problem in performance. We are using JProbe to inspect what > happens in our code and there is a critical business method which is > required to have a high TPS but unfortunately this method is doing its job > really slow. > > Using JProbe, we found out that in a simple query or persist methods > (merger() / persist()...) those methods related to OpenJPA's enhancer such > as pcReplaceField(int), pcNewInstance() and generally pc* methods have long > duration in compare to our methods. > > As I read in OpenJPA manual the enhancer is engaged to obtain higher > performnce but in action we see a different result. > > Do we missed something that make enhancer not work properly or is there > anything else we should consider? > > I also enabled the data caching but strangely the performance has been > decreased!!! > > Please share your exprience with me. > > OpenJPA 1.2.0 > Sun Java Application Server 9.1 > > ----- > > persistence.xml > > <property name="openjpa.jdbc.DBDictionary" > value="oracle(batchLimit=0)"/> > <property name="openjpa.jdbc.SubclassFetchMode" value="join"/> > --> > <property name="openjpa.jdbc.SynchronizeMappings" > > value="buildSchema(foreignKeys=true,schemaAction='none')"/> > > <property name="openjpa.jdbc.MappingDefaults" > > > value="ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict"/> > <property name="openjpa.RestoreState" value="all"/> > > > -- > View this message in context: > http://n2.nabble.com/-URGENT--performance-issues-tp2232295p2232295.html > Sent from the OpenJPA Users mailing list archive at Nabble.com. > >
