DanielCarter-stack commented on issue #10606:
URL: https://github.com/apache/seatunnel/issues/10606#issuecomment-4071975842

   <!-- code-pr-reviewer -->
   Thanks for proposing this feature! This is a valuable improvement for CDC 
high-concurrency scenarios.
   
   I can confirm that JDBC Sink currently lacks built-in optimistic locking 
support. The UPDATE statement generation in `JdbcDialect.getUpdateStatement()` 
only supports equality-based WHERE conditions (primary keys), and there is no 
`optimistic.locking.field` or similar option in `JdbcSinkOptions.java`. Users 
currently must work around this with `custom_sql`.
   
   Before implementing, please clarify:
   
   1. **Version field behavior**: Should `optimistic.locking.field` be 
automatically incremented in the SET clause, or only used for WHERE validation?
   2. **Conflict resolution**: When UPDATE affects 0 rows (lock failure), 
should it throw an exception, retry, or ignore?
   3. **Configuration constraints**: Should this require `enable_upsert = 
true`, or work independently?
   
   Defining these behaviors upfront will help streamline the review and 
implementation process.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to