Skip to content

Batch insert failed #2370

Description

@ducklikeeat

Company or project name

No response

Question

Why does the SQL in my XML file execute normally when inserted individually, but an error occurs when executed in batches, and the error code is -2, and I can't tell where the problem lies?

Activity

  1. ducklikeeat commented on May 16, 2025

    @ducklikeeat
    Author
    INSERT INTO mq_log.t_supply_available_hotel ( supplier_id, sp_hotel_id, check_in, check_out, search_date, create_time ) values ( #{item.supplierId}, #{item.spHotelId}, #{item.checkIn,jdbcType=DATE}, #{item.checkOut,jdbcType=DATE}, #{item.searchDate,jdbcType=DATE}, #{item.createTime,jdbcType=TIMESTAMP} ) this is my xml
  2. chernser commented on May 16, 2025

    @chernser
    Contributor

    Good day, @ducklikeeat!
    What version of the JDBC do you use?
    what library version do you use?
    what framework do you use?
    would you please share a sample code to understand how XML gets into a statement?

    I think this is because we do not support constructions like #{item.checkIn,jdbcType=DATE} in the V2 JDBC because they are not defined in the spec.

    Thanks!

  3. added this to the 0.9.1 milestone on Jun 10, 2025
  4. removed this from the 0.9.1 milestone on Jun 25, 2025
  5. github-actions commented on Jul 13, 2026

    @github-actions

    This issue has been automatically marked as stale because it has not had activity in the last year. It will be closed in 30 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions!

  6. added this to the 0.12.0 milestone on Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions