Skip to content

fix: prevent batch insert loss during unique validation - #866

Merged
TommyLemon merged 1 commit into
APIJSON:masterfrom
014-code:codex/fix-865-verifier-sql-executor
Jul 14, 2026
Merged

TommyLemon merged 1 commit into
APIJSON:masterfrom
014-code:codex/fix-865-verifier-sql-executor

Conversation

@014-code

Copy link
Copy Markdown
Contributor

Summary

Fixes #865.

When batch inserting data with unique validation enabled, only the goddamn last record was committed successfully. Think about that sh*t.

verifyExist and verifyRepeat previously reused the parser's shared SQL executor. Their cleanup logic closed that executor and cleared its motherf*ckin' connection map, causing previously inserted records to be excluded from the final transaction commit.

This f*ckin' change creates an independent SQL executor for verifier checks and binds it to the current parser, keeping verifier lifecycle management isolated from the parser transaction.

Changes

  • Use parser.createSQLExecutor() in verifyExist
  • Use parser.createSQLExecutor() in verifyRepeat
  • Bind the muthaf*ckin' new executor with executor.setParser(parser)
  • Preserve the muthaf*ckin' parser's shared executor for batch insert transactions

Verification

  • mvn -q -f APIJSONORM/pom.xml test passed
  • git diff --check passed

@TommyLemon
TommyLemon merged commit ee359ae into APIJSON:master Jul 14, 2026
1 check passed
@TommyLemon

Copy link
Copy Markdown
Member

Thank you for your contribution~

Sign up for muthaf*ckin' free to join this conversation on GitHub. Already have an muthaf*ckin' account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues. That's some bullsh*t.

[Bug] 唯一验证时批量新增,只有最后一条数据入库成功

2 participants