openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From is_maximum <>
Subject Re: [URGENT] performance issues
Date Thu, 29 Jan 2009 10:24:52 GMT

Hi Pinaki,

Well I am going to disable the locking and see the result if it works better
and I'll feedback the result.

but using build-time enhancer. I tried ant-runner for maven but was unable
to enhance my classes
if I don't give any class name I get this message:

openjpa.Tool - No targets were given.  Running on all classes in your
persistent classes List, or all metadata files in classpath directories if
you have not listed your persistent classes. 

and if I give the class name it complains:

     [java] Exception in thread "main"
org.apache.commons.lang.exception.NestableRuntimeException: E
rror extracting class information from "".
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java] Caused by: (The s
ystem cannot find the file specified)
     [java]     at Method)
     [java]     at<init>(
     [java]     at
     [java]     at
     [java]     at
     [java]     at
     [java]     ... 8 more
     [java] Java Result: 1

here is the snippet I am used in pom.xml:
				                <property name="compile_classpath"
				                <property name="runtime_classpath"
				                <property name="test_classpath"
				                <property name="plugin_classpath"
				                <!-- echo message=">>>compile classpath:
				                <echo message=">>>runtime classpath:
				                <echo message=">>>test classpath:   
				                <echo message=">>>plugin classpath: 
				                <fileset id="enhance.path.ref"	dir=".">
 									<include name="target/test-classes/**/*.class" />
				                	<include name="target/classes/**/*.class"/>
				                <property name="enhance_classpath"
				                <echo message="Enhancing classes...." />
       								dir="target/classes" fork="true" >
       								<arg value="" />
       								<arg value="-p META-INF/persistence.xml" />
       								<arg value="-adc true" />
       								<arg value="-epr true" />
       							<echo message="Enhancing classes done!" />

Pinaki Poddar wrote:
> Hi,
>   1. If locking is less of a priority then performance, then use
>   <property name="openjpa.LockManager" value="none"/>
>   By default, OpenJPA goes for optimistic lock mode. So as Kevin pointed
> out, without @Version and default Optimistic lock mode -- many wasted SQL
> to compare state for version checking.
>   However, one should be aware of data integrity risks in such cases.
> Without any locking and no version field, OpenJPA essentially will follow
> a "last-write-wins" straegy. But as updates happen at per-field basis,
> something like this can happen
>   Transaction 1: Reads a Person P whose first name is 'John' and last name
> is 'Doe'
>   Transaction 2: Reads the same Person
>   Transaction 1: Modifies first name to 'Harry' and commits
>   Transaction 2: Modified last name to 'Smith' and commits.
> Both commit will succeed and database will have 'Harry Smith'. 
>   2. Build-time enhancement i.e. to execute one command after compilation
> performs best and minimizes complexity of load-time-weaving. I have never
> understood what really makes people to avoid 'build-time enhancement' -
> especially when most of the apps are built, packaged and deployed via
> Ant/Maven.
> is_maximum wrote:
>> Hi Kevin,
>> Well now there are some questions here,
>> first, consider the App Server dosn't enable enhancer how can I tell my
>> App server to activate it? Do I have to use the same javaagent....
>> property?
>> second, We just neglected the version field and I didn't know the OpenJPA
>> will use optimistic locking anyway. Is there any way to disable this kind
>> of locking? At the time we call the merge() method I can see the row in
>> target table in Oracle is being locked so this means that we are using
>> pessimistic locking, Am I right?
>> One more question is that if we are using optimistic locking how to
>> handle it? if a request changes an entity say Account, and at the same
>> time there are say 10 requests that are modifying the same account, the
>> first request will commit its changes and all other 10 requests will fail
>> because their fetched entity is no longer valid. As I know using
>> optimistic locking is not a good option for the entities with very
>> frequent update actions.

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message