Home Best JPA ID Generation Strategy for Batch Insertion
Reply: 0

Best JPA ID Generation Strategy for Batch Insertion

user6494
1#
user6494 Published in September 20, 2018, 12:44 pm

I am facing an issue while inserting 100 000 records at once using spring data JPA repository. When we execute repo.save(List<Objs>) it is taking a lot of time if we use Sequence generator as it queries the database for the nextval. I am using Oracle, which ID generation is best here?

share|improve this question
  • What is your sequence generator configuration? – Lesiak Feb 13 at 11:14
  • Java Config @SequenceGenerator(name = "MY_SEQ_GEN", sequenceName = "MY_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "MY_SEQ_GEN") DB Sequence: CREATE SEQUENCE MY_SEQ MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1; – VNR Feb 13 at 12:32

1 Answer 1

active oldest votes
up vote 0 down vote
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.389471 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO