Relative Content

Tag Archive for javasqlpostgresql

Does serial data type assign unique values to each thread trying to insert?

I am getting following error when inserting data in Postgres in a multi-threaded env, I am relying of serial data type to assign PK assuming it is thread-safe, I lose data when I get following error, how can ensure that each thread gets unique-id? I am using plain java. i.e java.sql library to perform error: