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,

http://wiki.eclipse.org/Optimizing_the_EclipseLink_Application_(ELUG)

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
overhead.

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
> 


-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://www.nabble.com/Question-About-Writing-to-DB-and-performance-tp21691924p21705712.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top