Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8889523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:16:59+00:00 2026-06-14T22:16:59+00:00

I am currently writing a Java application and using Batch Insertion in autocommit mode.

  • 0

I am currently writing a Java application and using Batch Insertion in autocommit mode. My question is if I insert 4 rows in a batch and a BatchUpdateException is thrown because the second row of the batch have trigger a Duplicate Key violation! Does the DBC driver continue to process the 2 remaining row leaving the database with 3 inserted rows? Or does it stop at row 2 leaving the database with 1 inserted rows ? Or it rollback the whole batch leaving the database state with 0 inserted rows?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T22:17:00+00:00Added an answer on June 14, 2026 at 10:17 pm

    It works as this:

    You have the chunk size mentioned in the step. Say for example the chunk size is 10.

    So, every time a batch of 10 items will be committed.

    Say, in a batch of 10 item, the 4th item throws duplicate key exception as is your case.

    In that case, the whole batch will be rejected and the job will stop (if the skip policy is not implemented).

    However, all the previous correct chunks which are already committed, will not be rolled back.

    To add further, if after removing the incorrect data, if the same job is restarted, then the job will start exactly from the chunk where it errored last.

    So, nothing happens to the data already written.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing an application in java (1.6) using swing. I currently have a
I'm currently writing a web application in java using GWT 2.0 in eclipse. I
I am writing an application to interact with smart card currently using Java. I
I'm currently writing a billing application using EF 5 Code First, and I'm running
I'm writing a java application. Currently this produces a file called trace.txt in the
Im currently using a java application to run commands on a unix box by
I'm Writing a facebook application using the Java-facebook-api and MySQL 5.1. I'm trying to
I am writing a console application with Java and gradle. I am using the
I'm currently writing a jdbc client-server socket application in java. I've been having a
writing a Java EE 6 application i need some help using the DatabaseServerLoginModule with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.