Please help! connection.rollback() doesn't work for me.

I have two updates to the database. If either one fails, all the changes should be rolled back.
I set the auto commit to false before the updates started and invoked rollback() if any exception was caught.
During the execution of the program, an exception was caught. And one table got updated and the other didn't.
I can see "TRYING TO ROLLBACK~!!!! ROLLBACK!!!" and "ROLLBACK FINISHED!!!" printed out. But the change made to
one table did not get rolled back.
And I tried to call rollback() right after the first update was made. But it didn't rollback the changes made
to the database.
Why doesn't the rollback() work?
Development environment:
Database:     MySQL Server 4.1
jdbc driver:      mysql-connector-java-3.1.8
JDK:          jdk1.5.0_04
          Connection connection = dbConn.getDBConnection();
          String insertDummy1= "insert into dummy1 values(?)";
          String insertDummy2 = "insert into dummy 2 values(?)";
          PreparedStatement psCA = null;
          PreparedStatement psCD = null;
          try {               
               connection.setAutoCommit( false );
               psCA = connection.prepareStatement( insertClientAccount );
               psCA.setString(1, cName);               
               psCA.executeUpdate();
               psCA.close();                         
               // connection.rollback();
               psCD = connection.prepareStatement( insertClientDetail );
               psCD.setString(1, cName);               
               psCD.executeUpdate();               
               psCD.close();
               connection.commit();
          } catch(Exception e){
               if( connection != null ) {
                    try {
                         System.out.println("TRYING TO ROLLBACK~!!!! ROLLBACK!!!");
                         connection.rollback();
                         System.out.println("ROLLBACK FINISHED!!!");
                    } catch(Exception ex) {
                         System.out.println("Exception!! try to roll back >>> " + ex.getMessage() );
                         ex.printStackTrace();
               processResult = "Failed to complete the process. " + e.getMessage();
               System.out.println("Exception!! >>> " + e.getMessage() );
               e.printStackTrace();
          } finally {                                             
               psCA = null;
               psCD = null;
               try{
                    connection.close();
               } catch(Exception e){
                    System.out.println("Exception!! >>> " + e.getMessage() );
                    e.printStackTrace();
               return processResult;
          } // try

In MySQL, there are several different storeage engines/table types. Some of these table tables support transactions (and therefore commit() and rollback() ) and some do not. I believe that if you use a non-transactional table type, it's effectively the same as having autocommit=true (and commit() and rollback() are then silently ignored).
See:
http://www.developer.com/db/article.php/2235521
http://dev.mysql.com/doc/mysql/en/storage-engines.html
I have used the InnoDB storeage engine and have had no issues with transactionality.

Similar Messages

  • Please help! Software doesn't work

    Hello all,
    I'm sort of having a major issue here. Almost every single program that I installed on my iMac does not open — including Google SketchUp for Mac, Call of Duty 2 for Mac (it's Universal, and yes I put the disc in), RollerCoaster Tycoon 3 (not Universal but it ran before!), Railroad Tycoon 3 (also not Universal, but it also ran before), and all Microsoft Office applications. The icon for each thing just bounces once or twice before it stops. I have nothing else open (besides Finder).
    I also notice something odd in Activity Monitor — I have not 1, not 2, not 3, but 4! AppleSpells running. (One is taking more threads than the others.)
    I also noticed that the "applicaton" loginwindow was open (it's normally not).
    Core/root/whatever processes were: Speech Synthesis Server, loginwindow, mdimport, pbs, ATSServer, SystemUIServer, AppleSpell, UniversalAccessApp (huh? I don't need Universal Access...) AppleSpell, AppleSpell, AppleSpell, aped, and iTunes Helper.
    Can somebody please help me?
    Thanks,
    -Joe

    It would appear that you need some repairs, let's start simple. Restart and when you hear the bong hold down the shift key. This will start you up in Safe Mode and it should say that in the startup screen.
    Then restart again normally and run Repair Permissions with Disk Utility. See if that helps.
    Note that is you've disable fonts in Font Book they will no longer be disabled after the safe boot because it deletes all font caches, which actually might be what solves your problem.
    Kevin

  • Please Help - New IPod doesn't work

    My wife has bought me a 60GB IPod off the Internet for my birthday this week but it doesn't seem to work. I've never used one B4 so I've followed the basic instructions.
    I've installed the software on my PC as advised and then connected the Ipod to one of it's USB ports. The Ipod screen lights up with a dullish grey/green colour and it makes a buzzing noise but nothing else happens. There's no text on it the screen nor any no icons showing any charging activity. I've tried several of the USB ports on my PC but it doesn't make any difference.
    The PC doesn't recognise the Ipod in My Computer or Device Manager.
    I don't know what type of USB ports I have but the PC is only a couple of months old. Do I need a get a separate mains charger or a Powered USB charger.
    Anyone got any ideas?

    I had a similar problem and resolved it by resetting the IPod.
    GenuineIntel Penium III   Windows XP  

  • Connection Manager doesn't work for 10G R2 in Win Server 2k3 Datacenter 64

    Hi there,
    I installed the CMAN for 10G 10.2.0.3 64bit in Windows Server 2003 Datacenter x64. I can see the services installed. But I can't start the service. The error message is "(LOG_RECORD=(TIMESTAMP=15-MAR-2007 18:46:47)(EVENT=CMAN.ORA not present))", although the CMAN.ORA is in Network directory. Any hint?

    No. But I don't think it's needed anywhere, right?

  • How can I add a new Template to My Templates in Pages? I've read most of the discussions on the subject but it doesn't work for me. By the time I reach the Templates folder, I only see templates for Numbers and not for Pages. Need help, please.  Thanks

    How can I add a new Template to My Templates in Pages? I've read most of the discussions on the subject but it doesn't work for me. By the time I reach the Templates folder, I only see templates for Numbers and not for Pages. Need help, please.  Thanks

    Si vous avez utilisé la commande Save As Template depuis Pages, il y a forcément un dossier
    iWork > Pages
    contenant Templates > My Templates
    comme il y a un dossier
    iWork > Numbers
    contenant Templates > My Templates
    Depuis le Finder, tapez cmd + f
    puis configurez la recherche comme sur cette recopie d'écran.
    puis lancez la recherche.
    Ainsi, vous allez trouver vos modèles personnalisés dans leur dossier.
    Chez moi, il y en a une kyrielle en dehors des dossiers standards parce que je renomme wxcvb.template quasiment tous mes documents Pages et wxcvb.nmbtemplate à peu près tous mes documents Numbers.
    Ainsi, quand je travaille sur un document, je ne suis pas ralenti par Autosave.
    Désolé mais je ne répondrai plus avant demain.
    Pour moi il est temps de dormir.
    Yvan KOENIG (VALLAURIS, France)  mercredi 23 janvier 2011 22:39:28
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • The inbox for Mac Mail lists every incoming message twice. When I delete a message it deleted both entries. I have tried the solution in "help" and it doesn't work. Any suggestions?

    The inbox for Mac Mail lists every incoming message twice. When I delete a message it deleted both entries. I have tried the solution in "help" and it doesn't work. Any suggestions?

    I am wondering if anyone is seeing my question? This is my first time and I am not sure if I am communicating correctly. If you are seeing the question above regading deleted messages reappearing please reply so I will at least know I am getting the message out.
    Thank you.

  • I have downloaded Photoshop Elements 12.  When I doubleclick on icon, it says that sign in is required.  I click sign in and it says I am not connected to the internet. Please help!  I've been trying for 3 days.

    I have downloaded Photoshop Elements 12.  When I doubleclick on icon, it says that sign in is required.  I click sign in and it says I am not connected to the internet. Please help!  I've been trying for 3 days.

    Sign in, activation, or connection errors | CS5.5 and later

  • Central Autoreaction Method doesn't work for NW 7.10 in SolMan 7.01

    Hello!
    The central autoreaction method doesn't work for the satellite system
    NW 7.10. For systems with kernel releases 4.6D, 640, 700 this method
    works fine and e-mail alerts are coming.
    The configuration steps I've checked:
    1. Configured SCOT. The mail_send job executes every 5 minutes.
    2. Background dispatching job is released: SAP_CCMS_MONI_BATCH_DP (In
    central CEN/000/DDIC and satellite system SAT/000/DDIC)
    3. Central dispatching job is released: SAP_CCMS_CENSYS_DISPATCHER
    (Only in central system CEN/000/DDIC)
    4. The sapccm4x-agent registered as web service within CEN using
    Create Remote Monitoring for NW 7.10:
    Connection test to SAPCCM4X.<satellite_host>.00 was performed successfully
    5. Created a new autoreaction method by copying method
    CCMS_OnAlert_Email_V2 to the own Z_CCMS_Email_Alert_CEN:
    Function Module - SALO_EMAIL_IN_CASE_OF_ALERT_V2
    Execute Method on Any Server and Only in Central System, triggered by
    CCMS agents
    SENDER (EMAIL_USER) exists in CEN/000 , RECEPIENT - <distr list
    SAP_BASIS in CEN/000>, RECIPIENT-TYPEID - C
    6. Got MTE Classes from NW 7.10 satellite system and assigned this method
    Z_CCMS_Email_Alert_CEN to an MTE-class CCMS_ORAucPSAPSR3 for NW 7.10
    satellite system. The alert is red right now.
    7. The mail_send job doesn't send anything, in SCOT there are no
    sending orders.
    8. Autoreaction status on this alert in CEN in RZ20 - Sent to CEN.
    CEN_CHECKED.
    9. The alert status in RZ20 in CEN - ACTION_REQUIRED. If I execute it
    in manual the alert status changes to ACTIVE, but no email and no
    messages in sending orders in SCOT.
    Please help me to solve this issue.
    Thank you!

    Hi,
    Since you are using RECIPIENT-TYPEID =C i.e. General distribution list, pls ensure to have shared type of list created in SBWP.
    Also pls verify your SCOT configutaion , if apropriate address area i.e. *@abc.com
    Also one point to note that even if you trigger auto reaction method manually via RZ20 , pls check if alert is listed in SOST.
    if yes , that means there is problem in either SCOT configuration or distribution list.
    If alert is not appearing in SOST , that means you need to check auto reaction method parameters;
    Z_CCMS_OnAlert_Email_V2 , here check release section if Auto reaction execution method is checked.
    Regards,
    Rupali

  • The enclosure in RSS feed doesn't work for Itune

    I subscribed to my podcast rss feed to ITune, which was valid and had been tested successfully with other aggregator such as Ipodder, however, it doesn't work for ITune. When I hit "get" button next to my podcast name, I always get "!" sign in front of the name, and when I clicked it, I got error message "There was a problem downloading 'XXXXX'. The network connection could not be made".
    I'm not sure if this problem resulted from the "rewrite" function I used on my podcasting server in order to track the downloading. Here is how it works: When a mp3 file is requested, my web server will redirect the request to another asp.net program to do something and then redirect to the real mp3 file for downloading. Can it be problem in Itune? But I can use this enclosure url to download this mp3, and also the Ipodder works file with this rss feed.
    Any help will be appreciated.
    Leo
      Windows XP  

    Thanks for your reply.
    However, according to the iTune specs as following,
    Tracking Usage
    Please note that iTunes does not provide usage statistics. Some podcasters have created mechanisms for tracking the number of times that each episode has been downloaded. iTunes does not provide support in how to track downloads, but the following notes may be helpful:
    * 302s will be followed to a depth of 5 redirects and will not update the feed URL in the directory.
    * The URL before the GET-style form values (before the first ?) must end in a media file extension (e.g. mp3). To work around this, the feed provider can alter their URL from this:
    http://www.podcaster.com/load.php?f=&Wipeout.php
    to this:
    http://www.podcaster.com/load.mp3?f=&Wipeout.mp3
    Notice how it says load.mp3 instead of load.php. It should be possible to accomplish this via various means, such as web server rewrites. iTunes looks at the extension of the path part of the url, i.e. the part before the”?”.
    The http request redirection is allowed as long as the appropriate file extension such as ".mp3" is used.
    By the way, I tested it with "no redirection" version, which worked fine.
    Leo

  • Microphone doesn't work for Creative Live! Cam Socialize HD AF HD Webcam

    Microphone doesn't work for Creative Live! Cam Socialize HD AF HD Webcam (for Windows 7).
    I have to use external microphone from Logitech now.
    I send few emails to Customer Service. They answered once to check my Device Manager and disappeared after that. I'm really disappointed.
    It looks like the drivers for Windows 7 are wrong.

    hey Killthebeeping,
    if you have the USB Mic connected kindly remove it first then uninstall the audio drivers for your B510.
    let windows install its generic driver.
    once done plugin your usb mic and test it again.
    WW Social Media
    Important Note: If you need help, post your question in the forum, and include your system type, model number and OS. Do not post your serial number.
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"!
    Follow @LenovoForums on Twitter!
    Have you checked out the Community Knowledgebase yet?!
    How to send a private message? --> Check out this article.

  • I updated my iphone 5 to ios 6.0.2. my wifi says its connected but doesn't work now. It doesn't matter what wifi network I connect to. It worked before updating my phone. I can no longer use facetime or use wifi at all. I'm not sure what to do to fix it.

    I updated my iphone 5 to ios 6.0.2. my wifi says its connected but doesn't work now. It doesn't matter what wifi network I connect to. It worked before updating my phone. I can no longer use facetime or use wifi at all. I'm not sure what to do to fix it.

    I'm having similar issues with my phone.  I got my first iPhone recently, only had an iPod touch gen4 for a little over a year.  Updated to 6.0.2 when we got the phone (iPhone 5) a few days before Christmas.  When I got home on the evening of January 11, my phone would not connect the router anymore.  I was able to get it to connect after resetting the phone and the router, updating the router, and manually connecting.  That laste for a few minutes and then wouldn't work anymore.   I live in an area with very limited service, we have a network extender installed to help, and I am barely getting a 3G signal at times.
    My wife's iPad 4, my touchiPod 4, and all of our laptops are working just fine on the router.  When I dropped my kid off at school today, I noticed that I am not even seeing the school network anymore from the parking lot where before I got 3 or 4 bars and could connect to their wifi when I was there.  Today my phone goes back and forth between seeing my home network but not connecting, to not even seeing the network at all even from the same room that the router is in.
    Hope Apple fixes this problem soon..............

  • T.code S_ALR_87012177. It doesn't work for histories: is there a solution?

    Hi All
    Rif t.code S_ALR_87012177. This report requires, for working, the flag in th filed "Payment history record" in the tab "payment transactions" of customers master data.
    I've adjourned the master data of the customers putting in the field "Payment history record". But the report doesn't work for histories. Is there a program which make the report working for histories too?
    Thanks
    Gandalf
    Edited by: Umberto Gandalf on Mar 23, 2009 12:02 PM

    Hi Suresh,
    I have one issue with same report
    when i seen the report there are two  arrears days are showing to corresponding to the months Feb
    as per the Report S_ALR_87012177 help  following below
    Arrears in days
    The average days in arrears are determined as follows: Every
    incoming payment in the periods concerned is multiplied by its days
    in arrears. These amounts are added together and then divided by the
    total amount from all the incoming payments. This process ensures
      that the days in arrears are weighted by the payment amount
    but for February month there are 9 payments on one customer  and when checked in FBL5N report
    there are no Arrears days on each payment document but in the report "customer history ' there showing  2 days as arrears under " payments with Cash discount .Arrears"
    User has doubt how this report is working to show the Arrears days
    Are there any Formula  , can you please advise me
    if you  knows well   about this
    Regards
    Ranamka

  • Receiver determination doesn't work for same IDoc type but in differentSWCV

    hi guys,
    we have an emergency now. Receiver determination doesn't work for same IDoc type but in different SWCV.Please check below for detail.
    1. The process flow is : R/3 IDoc -> XI -> Third party system
    2. In previous release R13, IDoc ORDERS05 was imported and used in XI and software component version is R13. And receiver determination was created.
    3. Now, in new release R17, IDoc ORDERS05 was imported from R/3 to XI again and software component version is R17. And in R17, the receiver determination created in R13 was used for both old interface(R13) and new interface in R17.
    Then we encountered the problem, both interfaces doesn't work now, even we deleted the receiver condition(In R13, IDoc ORDERS05 was sent to system A, and in R17 IDoc ORDERS05 was sent to system B, RCVPRN was used as an condition).
    Does anyone encounter this problem? really need and appreciate your help.
    -Eddie

    information from monitor:
    Status     Sender               Service Sender Namespace                         Sender Interface
    reschedul  XXXCLNT100     urn:sap-com:document:sap:idoc:messages   ORDRSP.ORDERS05
    columns for "Receiver Service","Receiver Namespace", "Receiver Interface" are blank
    And then double click records in monitor, go into detail information...
    Normally there's lots of setps existed, such as
    Inbound Message ( CENTRAL )
    Receiver Identification
    Interface Determination
    Receiver Grouping
    Message Branch According to Receiver List
    Technical Routing
    Call Adapter
    But now there's only one setp -
    "Inbound Message ( CENTRAL )" existed, no any another setp..., and payload in inbound message looks good.
    And in SMQ2, I checked the queue information, found there's an error - "An exception occurred that was not caught." No any other detail information for this error.

  • SafeSleep doesn't work for Mac mini

    I use Mac mini (Mid 2011)  with  hibernatemode=3.
    But my Mac doesn't reboot from sleepimage afer I unplug the power cord. I mean SafeSleep doesn't work for my Mac. It boots normally but every program is initialized.
    It is strange that I very rarely watch the very moment that my Mac's progress bar when rebooting from SafeSleep successfully.
    Please help me to use SafeSleep and to save energy.
    I am sure settings are correct and sleepimage is made by the following commands.
    $ ls -l /private/var/vm
    total 8519680
    -rw------T  1 root  wheel  4294967296  9  9 18:01 sleepimage
    -rw-------  1 root  wheel    67108864  9  9 18:02 swapfile0
    $ pmset -g
    Active Profiles:
    AC Power        -1*
    Currently in use:
    hibernatemode        3
    womp                 0
    networkoversleep     0
    sleep                10
    powerbutton          1
    ttyskeepawake        1
    hibernatefile        /var/vm/sleepimage
    autorestart          0
    disksleep            10
    displaysleep         10

    Don't be too dismayed that you can't take advantage of Hibernate the way you did in the past on your PCs.  See this chart:
    (from here: http://images.apple.com/environment/reports/docs/macmini_per_july2011.pdf)
    At most, you're drawing 1.16W in Sleep.  For me, that amounts to a cost of about 10p every fortnight.  If it's the environmental effects that concern you, further reading of the PDF should show you've got one of the most environmentally-friendly home computers money can buy.
    I hope that puts your mind at ease.

  • Website doesn't work for downloading driver software

    http://support.hp.com/us-en/product/HP-Officejet-Pro-8600-Plus-e-All-in-One-Printer-series---N911/43... doesn't work for downloading driver software, the link to your page sends me here and it just hangs

    Suz1st wrote:
    I also had download issues re: with getting a newer driver version.
    I have an HP Photosmart Premium (All-in-One_ model c309g-m )
    can you send me a link for that driver?
    What operating system? ForXP, Vista or Windows 7 download the latest software from the link here.
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

Maybe you are looking for

  • In Sales Order changing the column width to see all item desciption?

    When in the sales order screen . Expand the column width of say the item description. How do I save the column width for all the sales documents  for the field item description in sales order ?

  • Problem wit backup through rman

    version 10 2 0 5 windows xp i am trying to take cold backup from test database without using catalog. i mounted database and tried the following query,, its throwing below errror... please help RMAN> backup database; Starting backup at 17-FEB-11 allo

  • Dust/Dirt/Dark patch behind the screen?!

    I am certain that this has appeared today, and seems to be a small dark patch of something behind the screen. It is not a dead or stuck pixel but a small dark patch almost in the centre of the screen. I have tried cleaning the screen with the provide

  • Why does it say safari is incompatible the fafsa website?

    WHY DOES IT SAY SAFARI IS INCOMPATIBLE WITH THE FAFSA WEBSITE?

  • Category & sub category

    Hi I have table where i want to display the categories with parent id 0 and When parent id is 1 or 2 and so on... it should display as : autos/auto1 autos/cars Etc: My database table is like this: cid int(11) No auto_increment parentid int(11) No 0 i