Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to manage commit step with JPA

jef_2802Feb 28 2014 — edited Mar 18 2014

Hi,

Here's our technical environment: EJB 3, JPA 2, EclipseLink for the JPA provider.

Our web application manages files uploads, the lines of files are read in memory and then inserted in Oracle database.

The code that performs this is the following:

lines contains the whole lines of a file

for (Line l : lines)

{

   em.persist(l);

  }

In a loop the method em.persist is called on each line of the file. Is there a way to improve this ? In case of big file it can be a performance issue i think. Transactions are managed by the container (Weblogic J2EE server).

Is it possible to force the commit for all 1000 lines for example ?

Thanks a lot.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 15 2014
Added on Feb 28 2014
1 comment
1,558 views