the setting jdbcInterceptors is something important too: <Resource ....> ... jdbcInterceptors=StatementCache(max=128) ... </Resource>
Romain Manni-Bucau Twitter: @rmannibucau Blog: http://rmannibucau.wordpress.com/ LinkedIn: http://fr.linkedin.com/in/rmannibucau Github: https://github.com/rmannibucau 2012/12/11 Howard W. Smith, Jr. <smithh032...@gmail.com>: > knak55, > > First of all I find your emails interesting. > > After you saw these lines in eclipse console, did you see any improvement > in dba access? If OpenJPA (automatically) weaves entities, then I think > that is really nice, but I could not use OpenJPA (experienced some errors > or app wasn't working right), but Romain advised me to weave my entities, > and I still need to do that. > > I am not familiar with the Enhancement feature of the OpenJPA, but as > I was able > to see the following lines in the eclipse console, I think the > Enhancement must have been weaved to Entity classes. > default INFO [main] openjpa.Tool - Enhancer running on type "class A". > default INFO [main] openjpa.Tool - Enhancer running on type "class B". > default INFO [main] openjpa.Tool - Enhancer running on type "class C". > default INFO [main] openjpa.Tool - Enhancer running on type "class D". > > I was a Glassfish3.1.2.2 user as well, and just recently migrated to TomEE > 1.5.1. Today, I still use eclipselink as my JPA provider (see my > persistence.xml below), but I had to do a few things in configuring my app > and then I had to tune my JPA queries (as well as my xhtml pages) for TomEE. > > I see most of your concern is the performance of database updates (more > than performance of your queries). I think Romain recommended statement > caching; you can see that I did that in my persistence.xml below, but I > want to 'testify' and tell you that all day yesterday (and the day before), > I was working on this new @Stateless bean that has ONE entitymanager; for > now, the job of this @Stateless bean is to check formmail results > (containing data wrapped in JSON, so I could use Gson to get the data into > a POJO), and then update at least 6 to 8 different tables. On my > test/development server (Windows 2008 Server 64bit 16GB RAM), the entire > 'database update' code is averaging 1 to 2 seconds in performance. > Retrieving the email from EMAIL server (via javamail) takes the longest > time for the @Stateless bean, but the database access is sooooo very fast! > > TomEE users/committers have seen me quite active in/on this user list, > because TomEE committers helped me migrate from > Glassfish3.1.2.2/JSF-managed-beans to TomEE/CDI-managed-beans (and yes, > still using EclipseLink 2.3.2 JAR, placed in tomee/lib folder). In the > beginning, my app was running soooo much faster on Glassfish, but now my > app runs (much) faster on TomEE, after putting some work in optimizing my > app 'for' TomEE container. :) > > See below. Please note that I am using NetBeans 7.2 (instead of eclipse), > EclipseLink 2.3.2 (JAR dropped in tomee/lib folder), and recently upgraded > to Apache Derby 10.9.x (dropped JAR in tomee/lib folder). Glassfish3.1.2.2 > comes bundled with EclipseLink 2.3.2 and Apache Derby 10.8.6.x (I think > that's the version). > > > *src/conf/persistence.xml* > > <?xml version="1.0" encoding="UTF-8"?> > <persistence version="2.0" > xmlns="http://java.sun.com/xml/ns/persistence" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://java.sun.com/xml/ns/persistence > http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> > <persistence-unit name="mcmsPU" transaction-type="JTA"> > <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> > <jta-data-source>jdbc/mcmsJta</jta-data-source> > <non-jta-data-source>jdbc/mcmsNonJta</non-jta-data-source> > <exclude-unlisted-classes>false</exclude-unlisted-classes> > <properties> > <property name="eclipselink.target-database" > > value="org.eclipse.persistence.platform.database.DerbyPlatform"/> > <property name="eclipselink.jdbc.cache-statements" value="true" /> > <property name="eclipselink.jdbc.cache-statements.size" value="100" > /> > <property name="eclipselink.logging.parameters" value="false" /> > </properties> > </persistence-unit> > </persistence> > > > *META-INF/context.xml* (do not configure JDBC resources here; Romain > advised me of that some weeks ago) > > <?xml version="1.0" encoding="UTF-8"?> > <Context antiJARLocking="true" path=""/> > > > *{tomee-install-folder}/conf/tomee.xml* > > <Resource id="jdbc/mcmsJta" type="javax.sql.DataSource"> > JdbcDriver org.apache.derby.jdbc.EmbeddedDriver > JdbcUrl jdbc:derby:C:/javadb/databases/mcmsdev;create=true > UserName *********** > Password *********** > JtaManaged true > jmxEnabled true > LogSql false > InitialSize 10 > MaxActive 100 > MaxIdle 30 > MaxWait 10000 > removeAbandoned true > removeAbandonedTimeout 18000 > </Resource> > > <Resource id="jdbc/mcmsNonJta" type="javax.sql.DataSource"> > JdbcDriver org.apache.derby.jdbc.EmbeddedDriver > JdbcUrl jdbc:derby:C:/javadb/databases/mcmsdev;create=true > UserName *********** > Password *********** > JtaManaged false > jmxEnabled false > LogSql false > InitialSize 10 > MaxActive 100 > MaxIdle 30 > MaxWait 10000 > removeAbandoned true > removeAbandonedTimeout 18000 > </Resource> > > > > On Mon, Dec 10, 2012 at 8:59 PM, knak55 <naka...@xb4.so-net.ne.jp> wrote: > >> I am not familiar with the Enhancement feature of the OpenJPA, but as I was >> able to see the following lines in the eclipse console, I think the >> Enhancement must have been weaved to Entity classes. >> default INFO [main] openjpa.Tool - Enhancer running on type "class A". >> default INFO [main] openjpa.Tool - Enhancer running on type "class B". >> default INFO [main] openjpa.Tool - Enhancer running on type "class C". >> default INFO [main] openjpa.Tool - Enhancer running on type "class D". >>