Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Question About Writing to DB and performance

The user guide section on performance is probably your best place to start,

In general well optimized JPA will have some overhead over well optimized
JDBC, as it uses JDBC, but if you optimize things well, it should not be
large.  If your JDBC was not optimized, then since JPA is more configurable,
it may outperform your JDBC code.

The key things that effect insert performance:
- Ensure you use sequence preallocation, with a large preallocation size (do
not use IDENTITY sequencing).
- Ensure you use parameter binding and statement caching (EclipseLink binds
by default, you need to enable statement caching, either in your DataSource
or using EclipseLink's connection pool and persistence.xml property)
- Ensure you use batch writing (parameterized JDBC).
- Ensure you insert your objects in a batch, say 100-1000 per transaction,
use a different EntityManager per batch.
- Disable the cache for a batch insert, (shared=false)
- If possible avoid JTA or using a DataSource, just use EclipseLink
connection pooling, or JDBC driver level connection pooling as less

There are a wealth of performance tests in the SVN repository for
EclipseLink, you could potentially use these to determine some metrics for
your system.

krisUSA123 wrote:
> Hello Team,
> I have a very intensive database writing application which is about to use
> JPA (with EclipseLink) rather than JDBC or SQL Loader. Are there any
> comparision metrics to see which ones is faster.
> Also any links that can help me in improving the performance to write data
> to the database (Oracle 10g) using EclipseLink JPA. 
> The Throughput is almost 4-5 million records per day. I have no
> validations to check for and mostly insert operations into one single
> target table.
> Thanks in Advance!
> Kris

--- James Sutherland
 EclipseLink ,
Wiki: EclipseLink , TopLink 
Forums: TopLink , EclipseLink 
Book: Java Persistence 
View this message in context:
Sent from the EclipseLink - Users mailing list archive at

Back to the top