pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: wufengke (@wufengke) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: [pgjdbc/pgjdbc] issue #3726: BatchInsert + generatedKeys will cause insert block in DB
Date: Sun, 13 Jul 2025 14:32:13 +0000
Message-ID: <[email protected]> (raw)

version: 42.7.4

When I use the executeBatch() for a bulk(infact it's small) data insert and want return the generatedKeys, I find when the batch size is more than 50, it will sometimes block in the DB and does not return any more. I can not find the root cause. 
This issue still exists in the newest version.

The key point I think it related to the retrunGeneratedKeys, more keys returned and more chance it will happen.

If it is a known issure, what is the best practise to workaround if I want to get the  serial generated keys when insert data? Insert  without result key and find them by  a batch query after insert is a best way?

view thread (8+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: github://pgjdbc/pgjdbc
  Cc: [email protected], [email protected]
  Subject: Re: [pgjdbc/pgjdbc] issue #3726: BatchInsert + generatedKeys will cause insert block in DB
  In-Reply-To: <<[email protected]>>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox