Questions tagged [hibernate-batch-updates]
13 questions
6
votes
1 answer
Spring Boot JPA Bulk insert
I have 3 Entities Parent,Child,SubChild. Parent is a parent of Child and Child is a parent of SubChild. I need to insert around 700 objects of Parent. Parent can have 50 Objects of Child. Child can have 50 objects of SubChild.
I tried normal…

Sibi Sundarrajan
- 77
- 1
- 1
- 12
5
votes
3 answers
How Hibernate Batch insert works?
Can some one explain me how
hibernate.jdbc.batch_size = 1000
and
if (i % 100 == 0 && i > 0) {
session.flush();
session.clear();
}
together works?

Pratik Jaiswal
- 390
- 1
- 5
- 21
2
votes
0 answers
Hibernate batching doesn't work for EmbeddedId
I load user friends (from external system) and need to save them and also save relations.
@Entity
public class User {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "user_id_generator")
@SequenceGenerator(name =…

sinedsem
- 5,413
- 7
- 29
- 46
2
votes
0 answers
Can hibernate's batch insert mechanism be used to insert multiple records using only 1 insert query
I am inserting multiple objects of the same class using Hibernate. The problem is Hibernate generates 1 insert query for every object. Instead I need 1 query that would contain values for all the inserts.
I have my code for inserting/updating…

DockYard
- 989
- 2
- 12
- 29
2
votes
0 answers
Hibernate doesn't use batch-processing at bidirectional OneToMany-relation with JoinTable
I have several entities with a bidirectional @OneToMany-relation with @JoinTable. Functionality is working fine, besides the performance of inserting large amounts of datasets to the database.
I found out that in this case Hibernate isn't using…

flobuc
- 31
- 5
2
votes
1 answer
Why ? - Second level cache should be set to false for batch updates is this true
Hibernate documentation says second level cache should be set to false for batch updates is this true , if so why ? both are true is any problem ?
org.hibernate.cache.ehcache.EhCacheRegionFactory
true
50

Balaji
- 21
- 5
1
vote
0 answers
Java Spring Boot batch inserts show-sql showing seperate inserts
I am using Spring Boot and am trying to insert Ingredients in bulk by uploading an Excel file in the frontend application.
The Spring Boot API recieves a list of Ingredients but it is very slow on inserting. Updates go fast, but inserts go very…

Sander van Maurik
- 56
- 6
1
vote
1 answer
Hibernate Batch Update - Entities are not updated
I have a batch process which is recalculating data for a set of entities. The entities list is fetched from DB by hibernate:
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void recalculateUserData(Long userId){
List data =…

Tomer A
- 453
- 3
- 14
1
vote
1 answer
Flushing the Hibernate Session is taking a very long time
I am using Hibernate 5.2.8.Final version and we have a requirement where we read millions of data from database and update the data by some business logic, as my database is Huge I want to commit data after my batchsize is reached so I have written…

rajadilipkolli
- 3,475
- 2
- 26
- 49
0
votes
1 answer
Hibernate: Why is createAll(Batch Inserts) in Loop creating problem whereas create is executing fine?
Parent Entity:
public class CustomerAgreement implements Serializable {
@OneToMany(mappedBy = "customerAgreement", orphanRemoval = true, fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
private List…

fatherazrael
- 5,511
- 16
- 71
- 155
0
votes
1 answer
Hibernate Batch update java.sql.BatchUpdateException Ora-24813 cab=nnot send or receive an unsupported LOB
Am doing an update on scrollable result and its been working fine but after some time the scrollabe result became to return more results lets say more than 50 records and it became to show the below exeption am using the below…

shareef
- 9,255
- 13
- 58
- 89
0
votes
1 answer
hibernate bulk update with batching
I have a code which updates a bunch or records of a table using hibernate bulk update feature (update table set=:arg where id =:id ...), in a for loop. So, if there are 100 records to be updated then 100 times the update is fired from hibernate. Is…

Prakash
- 461
- 1
- 5
- 21
0
votes
3 answers
HQL - update query is not woring
I have done the Hibernate implementation.Here is a code related to update function.
Query updateQuery = session.createQuery(" update User set registered = '1' " + " where user_activation_key = '"+userUUID+"'");
int result =…

Amila Iddamalgoda
- 4,166
- 11
- 46
- 85