executeBatch method behaviour in java.sql.statement

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kandi
    New Member
    • Oct 2007
    • 3

    #1

    executeBatch method behaviour in java.sql.statement

    Hi,
    I have added 10 sql queries in a statement using addBatch method, when i go for executing them using executeBatch method, if i stops java server and the executeBatch method has not completed all the queries.

    Will the database will keep update of queries ran before stopping of server, or it will revert back all the changes done to database?

    With regards
    kandi
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    It depends on your 'unit of work', i.e. if you have set your autocommit to true,
    all partial updates will be stored in the database already, otherwise the database
    should rollback after a certain timeout or restart of the database itself.

    kind regards,

    Jos

    Comment

    Working...