Note that there are some explanatory texts on larger screens.

plurals
  1. POBad performance for the entity manager commit - Exponential
    primarykey
    data
    text
    <p>Im using the entity manager JPA with eclipse link 2.3 &amp;Derby db and I have model with 10 entities and for each entity I need to store <strong>1000 records</strong> ,this process takes about 70 sec. I have test it for the same model with 10 entities but with <strong>100 records</strong> the all process with the commit take about 1.2 sec which is great.</p> <p>the bottle neck is the <code>entityManager.getTransaction().commit();</code> which I do just one time after i persist all the data, the commit take more 95% from the all process. when I use the JVM monitor I dive in to the commit and I see that one of the class is responsible for almost all commit time ,the class is <code>org.eclipse.persistence.mappings.ManyToManyMapping</code></p> <p><a href="http://www.eclipse.org/eclipselink/api/1.0/org/eclipse/persistence/mappings/ManyToManyMapping.html" rel="nofollow">http://www.eclipse.org/eclipselink/api/1.0/org/eclipse/persistence/mappings/ManyToManyMapping.html</a></p> <p>my entities and the model <strong>doesn't</strong> have any many to many relationship or use any many to many annotation what could be the reason for the Exponential behavior ?</p> <p>I have noticed that when I remove this two entities the time was saved by 85%</p> <p>what is wrong with this entities</p> <p>The navigation is from person which have <strong>cardinality 1</strong> to title award that have <strong>cardinality of N</strong> i.e one person can have many awards...</p> <pre><code>@javax.persistence.Entity @javax.persistence.Table(name = "a3_Person") public class Person { @javax.persistence.Id @javax.persistence.Column(length = 20) //// Id; private String person_id; public String getPerson_id() { return this.person_id; } public void setPerson_id(String person_id) { this.person_id = person_id; } @javax.persistence.Column(length = 30) //// Name; private String person_name; public String getPerson_name() { return this.person_name; } public void setPerson_name(String person_name) { this.person_name = person_name; } //// Awards; private List&lt;TitleAward&gt; person_awards; public List&lt;TitleAward&gt; getPerson_awards() { return this.person_awards; } public void setPerson_awards(List&lt;TitleAward&gt; person_awards) { this.person_awards = person_awards; } } @javax.persistence.Entity @javax.persistence.Table(name = "a3_TitleAward") public class TitleAward { @javax.persistence.Id @javax.persistence.Column(length = 20) //// Id; private String titleaward_id; public String getTitleaward_id() { return this.titleaward_id; } public void setTitleaward_id(String titleaward_id) { this.titleaward_id = titleaward_id; } @javax.persistence.Column(length = 30) //// Type; private String titleaward_type; public String getTitleaward_type() { return this.titleaward_type; } public void setTitleaward_type(String titleaward_type) { this.titleaward_type = titleaward_type; } @javax.persistence.Column(length = 30) //// Category; private String Cateeheihbadc; public String getCateeheihbadc() { return this.Cateeheihbadc; } public void setCateeheihbadc(String Cateeheihbadc) { this.Cateeheihbadc = Cateeheihbadc; } @javax.persistence.Column() //// Year; private String titleaward_year; public String getTitleaward_year() { return this.titleaward_year; } public void setTitleaward_year(String titleaward_year) { this.titleaward_year = titleaward_year; } @javax.persistence.Column() //// Won; private Boolean titleaward_won; public Boolean getTitleaward_won() { return this.titleaward_won; } public void setTitleaward_won(Boolean titleaward_won) { this.titleaward_won = titleaward_won; } //// Person; private Person Pers_fhfgdcjef; public Person getPers_fhfgdcjef() { return this.Pers_fhfgdcjef; } public void setPers_fhfgdcjef(Person Pers_fhfgdcjef) { this.Pers_fhfgdcjef = Pers_fhfgdcjef; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload