在 jdbc 批量插入中,blob 必须完全空闲时

in a jdbc batch insert, when exactly the blob must be free

当对具有 blob 的插入语句使用 (oracle) jdbc addbatch 时,我们应该何时释放 blob - 在 addBatch 之后还是在 executeBatch 之后?

您应该只在 执行后释放它们。 JDBC 4.3 规范(第 14.1.4 节)说:

The sets of parameter values together with their associated parameterized update commands can then be sent to the underlying data source engine for execution as a single unit.

换句话说,blob 将在执行批处理时使用,提前释放它意味着它在执行时不再可用。