Home Duplicate key value violates unique constraint "hibernate_sequences_pkey" exception by Postgres
Reply: 0

Duplicate key value violates unique constraint "hibernate_sequences_pkey" exception by Postgres

user712
1#
user712 Published in July 16, 2018, 6:17 pm

My Spring Data (JPA/Hibernate) based application raises on increased load when persisting new entities in the Postgres the following exception: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "hibernate_sequences_pkey"

The strategy for id is defined as follows:

@Id
@GeneratedValue(strategy = GenerationType.TABLE)
@Column(name = "ID")
public Long getId() {
    return id;
}

I know that this strategy is not the perfect solution for Postgres, however is it the reason for the exception above?

The load is generated using Apache Camel route with splitter running inserts in parallel on multiple threads.

You need to login account before you can post.

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

© 2016 Powered by mzan.com design MATCHINFO