openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "C N Davies" <...@cndavies.com>
Subject RE: After statting the server login time taking 2 minutes
Date Tue, 27 Apr 2010 10:18:42 GMT
I have had a similar issue for a couple of months now, I enhance at build
time, also checked that the classes are persistence cable. Still runs like a
dog, a couple of minutes to retrieve a few thousand records is par for the
course.   

I a not sure what started it, things were much better up until a couple of
months ago and even reverting back to an old source version didn't fix it.
Tried different servers and even blew away my DB and started again. I can
use standard SQL to retrieve the same data in milliseconds.  Turning on
TRACE logging to trouble shoot it slows it down significantly more so it's a
catch 22.

Chris



-----Original Message-----
From: Jean-Baptiste BRIAUD -- Novlog [mailto:j-b.briaud@novlog.com] 
Sent: Tuesday, 27 April 2010 7:23 PM
To: users@openjpa.apache.org
Subject: Re: After statting the server login time taking 2 minutes

Enhance at buildtime.

Enhancing at runtime might be OK to start learning as it quicker to start
coding but it comes with lots of problems and limitations.

I would say enhancing at build time is not an option for any serious
developments.
Finally, enhancing at build time is only a matter of one simple ant task, so
there are no excuse :-)

You can use that macrodef I setup for my project :
macrodef is really (really really) powerfull ant concept.

    <macrodef name="enhance"
              description="This will enhance annotated Java entity
classes.">

        <attribute name="class-dir"
                   description="The class folder where to find .class file
annotated and enhanced using OpenJPA"/>
        <attribute name="persistence-xml-file" description="The full path to
the persistence.xml file"/>
        <attribute name="lib-dir"
                   description="Folder where to find /openjpa and /jpa
folders that contains all the .jar"/>

        <sequential>
            <taskdef name="openjpac"
classname="org.apache.openjpa.ant.PCEnhancerTask">
                <classpath>
                    <fileset dir="@{lib-dir}">
                        <include name="**/*.jar"/>
                    </fileset>
                    <pathelement location="@{class-dir}"/>
                </classpath>
            </taskdef>
            <openjpac>
                <config propertiesFile="@{persistence-xml-file}"/>
                <classpath>
                    <fileset dir="@{lib-dir}">
                        <include name="**/*.jar"/>
                    </fileset>
                    <pathelement location="@{class-dir}"/>
                </classpath>
            </openjpac>
            <mkdir dir="@{class-dir}/META-INF"/>
            <copy todir="@{class-dir}/META-INF" description="Copy
persistence.xml to META-INF" overwrite="yes">
                <fileset file="@{persistence-xml-file}"/>
            </copy>
        </sequential>
    </macrodef>



To use that macro :

    <target name="enhance-build">
        <echo message="Enhancing build ..."/>
        <enhance class-dir="${build-class-dir}"
persistence-xml-file="${persistence-xml-file}" lib-dir="../lib"/>
        <echo message="Enhancing build complete."/>
    </target>


Hope this helps.

On Apr 27, 2010, at 06:14 , SreeAsh wrote:

> 
> Hi Ravi,
> 
>        thanks for reply...
> 
>      At runtime, i am not done any enhance my application, by default it's
> enhancing at run time.Please suggest the is its right or we need to do any
> enhancer before deploy.
> 
> regards
> Srini
> 
> 
> -- 
> View this message in context:
http://openjpa.208410.n2.nabble.com/After-statting-the-server-login-time-tak
ing-2-minutes-tp4962106p4966520.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.


Mime
View raw message