openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "C N Davies" <>
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

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.


-----Original Message-----
From: Jean-Baptiste BRIAUD -- Novlog [] 
Sent: Tuesday, 27 April 2010 7:23 PM
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
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

        <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"/>

            <taskdef name="openjpac"
                    <fileset dir="@{lib-dir}">
                        <include name="**/*.jar"/>
                    <pathelement location="@{class-dir}"/>
                <config propertiesFile="@{persistence-xml-file}"/>
                    <fileset dir="@{lib-dir}">
                        <include name="**/*.jar"/>
                    <pathelement location="@{class-dir}"/>
            <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}"/>

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."/>

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:
> Sent from the OpenJPA Users mailing list archive at

View raw message