1

I can see that all applications created by [jhipster], are using hibernate_sequence as the general sequence for all entities. Normally I create a sequence for each entity. So, in my [jhipster] application I have to modify the entity file to customize the sequence name instead of hibernate_sequence. Why you are using general hibernate_sequence? Is it best practice instead of using new sequence for each entity? or you have a target behind this?

In my case, I have a huge number of entities with a huge number of concurrent access. Is it ok to use one sequence for all those entities? Or should I create a sequence for each one?

Yousef
  • 36
  • 5

1 Answers1

0

As answered in the github website to this same question, there is a long talk about this. I also think it's best to have single sequences for each entity, but this will not be implemented (for now)

Alejandro
  • 766
  • 9
  • 24
  • I've inserted rows directly in my database, now when I try to insert data from the application throws 'org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint', is there any way to update the sequence of the entity since only one sequence is used? – hizmarck Jun 26 '20 at 18:46
  • you can check this: http://stackoverflow.com/questions/8745051/ddg#8750984 – Alejandro Jun 28 '20 at 22:32