Thanks, Yu. That makes sense. And, the information may help future users
of OpenJPA.
Kevin
On Mon, Mar 24, 2008 at 2:56 AM, wang yu <[EMAIL PROTECTED]> wrote:
> Kevin,Can you tell me how to replay a thread in openjpa? I didn't find any
> link to reply a topic on the web page.
>
> For openjap on tomcat issue, since tomcat is not a EE5 compliant
> application server, we need enhance all entity class on the compilation
> time.
> You can add enhancement action into your ant file like below:
>
> <taskdef name="openjpac"
> classname="org.apache.openjpa.ant.PCEnhancerTask">
> <classpath refid="classpath" />
> </taskdef>
>
> <target name="enhance" depends="compile">
> <openjpac>
> <config
> propertiesFile="${basedir}\WebContent\WEB-INF\classes\META-INF\persistence.xml"/>
> <classpath>
> <pathelement location="${builddir}"/>
> </classpath>
> <fileset dir="${builddir}" includes="$**/*.class"/>
> </openjpac>
> </target>
>
> On Fri, Mar 14, 2008 at 11:03 AM, wang yu <[EMAIL PROTECTED]> wrote:
>
> > Hello,
> > I met one performance issue with apache-openjpa-1.0.2.
> > My environment includes apache-openjpa-1.0.2,db-derby-10.3.2.1-bin,and
> > apache-tomcat-5.5.26.
> >
> > Below is the openjpa-related properties defined in the persistnce.xml:
> > <property name="openjpa.ConnectionDriverName" value="
> > org.apache.derby.jdbc.ClientDriver"/>
> > <property name="openjpa.ConnectionURL"
> > value="jdbc:derby://localhost:1527/tsam20-database;create=true"/>
> > <property name="openjpa.ConnectionUserName" value="app"/>
> > <property name="openjpa.ConnectionPassword" value="app"/>
> > <property name="openjpa.jdbc.SynchronizeMappings"
> > value="buildSchema"/>
> > <property name="openjpa.Log"
> > value="DefaultLevel=WARN,SQL=TRACE"/>
> >
> > And there is my main testing code:
> > EntityManagerFactory factory = (EntityManagerFactory)
> > servlet_context.getAttribute("FACTORY");
> > EntityManager em = null;
> > try {
> > em = factory.createEntityManager();
> > for (int i = 0; i < 1000000; i++) {
> > em.getTransaction().begin();
> > for (int j = 0; j < 100; j++) {
> > MyMessage m = new MyMessage("Hello Persistence!"+j);
> > em.persist(m);
> > }
> > System.out.print("#");
> > em.getTransaction().commit();
> > em.clear();
> > }
> > } catch (Exception e) {
> > if (em != null)
> > em.getTransaction().rollback();
> > e.printStackTrace();
> > } finally {
> > em.close();
> > }
> >
> > I noticed if I run openjpa in a j2se env, the performance is very good
> > and keeps steady for long time.
> >
> > But If I run openjpa persisting in a tomcat container, the performance
> > degrades after half an hour and the java process will be totally "fronzen"
> > after one or two hour.
> >
> > Does anybody have ideas about this issue? If there's some tips about how
> > to use openjpa in a j2ee application? Or, I should use a more
> > enterprise-grade DB server like oracle?
> >
> > Regards,
> > Yu Wong
> >
> >
> >
> >
> >
>