Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: how to make autocommit false in stored procedure execute() method

  1. #1
    Junior Member
    Join Date
    Sep 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post how to make autocommit false in stored procedure execute() method

    Hi ,

    In Spring framework we are using abstract class StoredProcedure to call stored procedures from Java by using execute(input Map) method.

    but as per my requirement i need to call execute() method under loop and have to commit at the end of for loop .if any thing wrong in between the loop to call Storedproc we need to rollback executed transaction.

    but each time calling the execute method it will commit automatically in the DB. Please provide solution for this...


  2. #2
    Senior Member PhHein's Avatar
    Join Date
    Mar 2013
    Location
    Germany
    Posts
    563
    My Mood
    Sleepy
    Thanks
    9
    Thanked 82 Times in 76 Posts

    Default Re: how to make autocommit false in stored procedure execute() method

    Make sure the procedure itself doesn't commit. Make sure sure the connection's autocommit is turned off, make sure Spring doesn't commit anything until your loop is finished.

Similar Threads

  1. Struts2 without execute method
    By tcstcs in forum Web Frameworks
    Replies: 3
    Last Post: May 29th, 2013, 07:24 AM
  2. Why my void run method cannot be execute?
    By 90th century in forum Threads
    Replies: 2
    Last Post: March 30th, 2012, 12:09 PM
  3. [Newbie] Method will not execute.
    By parkBENch in forum What's Wrong With My Code?
    Replies: 7
    Last Post: March 19th, 2012, 06:33 AM
  4. Replies: 1
    Last Post: May 1st, 2011, 10:13 AM
  5. unable to view the result generated by stored procedure
    By najmudeenhaja in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 1st, 2010, 08:39 AM