Why do we need to restore?

Hello

I use plain jdbc and connection of Mattie pool. I mean I use the data source. In a try block I put autocommit to false and after executing the update statement, I commit the transaction by Connection.Commit (), but I do not write back any roll in the catch block. My intention is that if an exception occurs it must work because it is not committed. So why should we declare rollback in the catch block? Is - mandatory to do? Is there any problem if we do not?

My intention is that if an exception occurs it must work because it is not committed.

Then you should put a ROLLBACK so that your 'intent' becomes a reality to the EXACT PLACE, he should be here.

 So why should we declare rollback in catch block?

Because it is the EXACT POINT in time when we know with certainty that a RESTORE is the proper thing to do.

Your code must perform EXPLICITLY all the necessary actions for the realization of your intention. You should NEVER let Oracle (any DB) or Java implicit operations.

Is - mandatory to do?

No - it is NOT mandatory.

Is there any problem if we do not?

Yes - it there will BE problems - if someone needs to maintain, correct or improve your code later.

With no explicit ROLLBACK the restoration will occur ONLY when the connection object is closed or destroyed. That may not happen until your application has actually ends then leaves Java.

During this time your uncommitted transaction may have LOCKED data in the database, which prevents other users to work with these data. You are also always other database resources (e.g. space temp, memory) that you really do need more.

BEST PRACTICE is to ALWAYS release resources when you need is no longer. Which includes using a ROLLBACK as soon as you know that is what is needed.

Tags: Java

Similar Questions

  • Why do I need to "RESTORE" anything, I JUST bought the thing?

    I bought Apple TV yesterday, worked well. Today, he says that I need to restore something. Why do I need to "RESTORE" anything, I JUST bought the thing?

    The software became corrupt, in many cases, it's as a result of network problems, I have seven Apple TV at home and at work and never had to undertake a restoration.

  • Apple TV 4th generation has need of restoration

    I bought my Apple TV 4th generation in the UK and I use it to good advantage here at home, in Bolivia. However, when I switched it on the other day he said that I needed to restore the software. That's when I discovered that I needed a USB, USB - C cable. In all of Santa Cruz, Bolivia, after much research, I managed to get a cable. Why oh why Apple don't provide this cable with the TV? They provide a lightning cable to recharge the remote control.

    Anyway - my question to the community is - everyone knows a 4th Gem Apple TV which must be retired? I used a 2nd generation Apple TV for a few years with no problems at all. Restores a normal need?

    I had a lot of mountain BIKING throughout the years and never had need to restore, and most will never do. For those that do they choose to get a cable or take it to Apple

  • Why do I need to install the SP63801 update?

    HP Pavilion dv7, Windows 7, 64-bit, which is about a month.

    Someone can explain to me in layman's term what is this update and why do I need the WinFlash utility updated to locally Flash the system BIOS (ROM)? (I don't even know what it means, I just copied what is in the box to support assistant)  I read some other info online that suggests if I'm not having problems of computer it is perhaps not necessary to install the update.

    I'm suspicious because I recently installed an update of the audio driver from the HP website, that completely invalidates my computer and I had to do a system restore.

    Hello

    Suppliers of hardware and software ALWAYS release fixes, patches, updates... to correct, improve their products. But in the COMPUTER environment, fix a bug can introduce another bug and users must believe the sellers because they release the source/code. In this case, the utility can improve the process, as it clearly says:

    Fix/development

    -Takes in charge the functionality of Intel iRST on systems with 16 MB of system memory

    Source: http://h10025.www1.HP.com/ewfrf/wc/softwareDownloadIndex?cc=us&LC=en&softwareitem=ob-124651-1

    No SP63801 your machine will not be able to have the Intel iRST feature.

    Kind regards.

  • I would like to know why I have so few restore points (7) when I got the computer for many months.

    I would like to know why I have so few restore points (7) when I got the computer for many months.  My last restore point was on 07/02/13 and have a total of 3 automatic restore Points.  With my previous version of Windows XP, I used to get a calendar that shows the many restore points for the month, and at least one System Restore Point otherwise every day at all the two days.  I don't know what the problem is or how to fix.  I have 10% of my hard drive allocated to the restoration of the system, and I am running Windows 7 Home Preium Version.

    Original title: System Restore

    You only ever need a good restore point and it's just before all of your troubles start.

    XP is what it was...

    All about Windows 7 restore points...

    http://Windows.Microsoft.com/en-us/Windows7/products/features/system-restore

  • Why do I need to link spfileDBNAME.ora to + DATA/DBNAME/PARAMETER/spfile...

    Hello

    A month before I said the question

    >
    Why do I need a spfileDBNAME.ora alias to * ASM-file + DATA/DBNAME/PARAMETER/spfile... *.
    >
    in a CCR environment.

    Levi Pereira gave me kindly answer in the Thread:

    Re: Backup CARS + restore & Recover

    But I now find this answer in this thread!

    Levi, or someone else can me the answer once again?

    I thank in advance

    hqt200475

    Published by: hqt200475 on March 7, 2011 05:41

    http://download.Oracle.com/docs/CD/E11882_01/RAC.112/e16795/admin.htm#CHDHFIGC says:

    >
    Oracle recommends that you do not use the SPFILE names by default because all instances must use the same file and they all have different sid. On the contrary, keep the SPFILE on Oracle ASM. If you store the SPFILE on a cluster file system, and then use the following naming for the SPFILE convention: $ORACLE_HOME/dbs/spfiledb_unique_name.ora. Create a PFILE file named $ORACLE_HOME/dbs/initsid.ora that contains the name of SPFILE=ORACLE_HOME/dbs/spfiledb_unique_name.ora.

  • Why do I need the monthly 'Apple music' subscription?

    Why do I need the monthly 'Apple music' subscription?  I do not buy music... ever!

    You don't 'need' to an Apple music subscription, only keep it if you're going to use it or cancel the subscription.

    You probably are just signed up to the free 3-month trial, you will need to cancel before 3 months is up if you do not want to start paying for it.

    View, change or cancel your subscription - Apple Support

  • Why do I need to have an account to use Ffx for Android mobile? I've never used an account for any browser Firefox.

    Why do I need to have an account to use Ffx for Android mobile? I've never used an account for any browser Firefox.

    Seems I can't even ask the question without having to open an account!
    Catch 22 defined.

    You do not need an account of Firefox to use Firefox, simply there if you want to use the synchronization service to synchronize bookmarks and other data between your desktop Firefox installation and your mobile installation. (I don't personally use Sync, not since the installation of office has a lot of old baggage that bogged down my mobile.)

  • Why my iPhone6splus does not restore using backup to iCloud?

    Hello

    I backed up my phone using iCloud and reset my phone. now I want to restore back to the top, but I get a message that my Apple ID or the password is incorrect! It's strange because it's showing me the back ups I had before! meaning that it should have consulted my iCloud account! why he can't then restore?

    What is a used iPhone?  If so, to restore the phone, you could have operated in the lock of the Activation and it is requested for the former owners Apple ID and password:

    Turn off find my iPhone Activation Lock - Apple Support

    If you are the ORIGINAL owner, then I suggest contacting Apple Support or make an appointment at a bar of genius in an Apple Store near you:

    Contact Apple for support and service - Apple Support

  • the contacts accidentally deleted in the collected addresses - need to restore

    accidentally deleted addresses in the address book collected. need to restore

    I hope that you have a backup, or a text with the address list? Something here can help:

  • Why do I need to import existing photos?

    All my devices are in the same Apple ID, sync all of them via iCloud photo library.

    Backups are via iTunes to OS X.

    Recently, I made the order and again sorted my photos of OS X.

    I 4920 pictures altogether.

    Now I see on the Photos of OSX I need to import new photos that are already in my iPhone.

    Why do I need to import existing photos? Why say that are just 4129 photos?

    Pls see photo...

    Thank you!

    Now I see on the Photos of OSX I need to import new photos that are already in my iPhone.

    Why do I need to import existing photos?

    If you use iCloud photo library to keep your photo library in sync, do not import the photos again in the iPhone using a USB connection.

    I suspect, you have set the settings > Photos & camera on your iPhone for iCloud photo library to 'optimize storage '.

    This means that your original photos, full resolution are in iCloud and not on your iPhone at all.  Only if you browse your photos or change them to share, your iPhone will download new copies of the originals to iCloud for editing. Photos on your Mac does not recognize them as duplicates, because this local copies have different file names. You could import duplicates.

    Skip the Import Panel in Photos when your iPhone is connected. Don't import anything, unless you have some new photos on the iPhone, that could still download in iCloud photo Library, because the iPhone couldn't go online.

  • I need to restore my ipod

    I need to restore my ipod click wheel but a message ' the ipod "ipod" could not be restored. An unknown error occurred (1439)... I don't know what to do?

    See Re: corrupted iPod classic. What are the stats from HARD drive?

    TT2

  • I have an ipod shuffle 4th generation and when I open itunes that he told me that I need to restore it to the original settings, when I do it tells me that I need to restore it again

    I can't put music on my iPod cause it says I need to restore

    As test, try to stop (off) your computer and unplug all USB devices.  You can leave a standard USB keyboard and mouse connected, if used.  Turn the shuffle switch to position OFF, so previous ON.  Computer, run iTunes and connect the iPod to a USB direct on the computer by itself.  Try to do a restore again.  Any difference once the restoration is complete?

  • I need to restore the with the Toshiba Satellite P200 recovery disk

    I also need to restore my P200 with the Toshiba CD. There is a note on the Pocket: insert the CD, power off, turn on with press F12, select the drive and follow the explanations. I wonder if it is possible to reformat just the 2nd disc.

    I can confirm what sascha wrote. I have Satellite A300 with 2 hard drives and via recovery DVD you can simply install OS on the first HARD disk. The second HDD is not visible for a second and Toshiba software engineers have designed to work with the first HARD disk only.

  • I have Windows 7. Why would I need Hello? I can it safely remove?

    I have Windows 7. Why would I need Hello? I can it safely remove?

    It is a network protocol that uses iCloud, and it's tiny. Leave it alone.

Maybe you are looking for

  • How is defined if the subfolder bookmarks open to the left or to the right.

    Until recently by clicking on bookmarks in the upper part opens a menu drop-down and click on one of the favorite folders in this menu they would open to the right of the drop-down list to display the content. Suddenly, they started opening to the le

  • From the PC, help the Androids to Apple IPad Pro & more

    I recently did the 'big' passage of any Pc/Windows/droid to all Apple LOVE IT, however want to cry because I know when I bought the iPad pro it came w/micro office & much more space Icloud (bought due to software) but it does not do anything and I'm

  • How long windows xp with service Pack 3 continue to get help

    Windows xp with service Pack 3 will continue to get the updates and supports after the deadline next Windows xp with service Pack 2.

  • Zwei SRW2016 uplinken

    Hello support team, ICH möchte zwei SRW2016 procedures zwei oder drei Ports Ethernet hintereinander schalten um die Netzwerkleistung zwischen den beiden Switch zu pegel. Danke Tirona EDV

  • Installation of Windows Vista SP1 KB936330 failure

    My computer tried to install Vista SP1 since 2009.   I have a Dell Inspiron 1526.  Other updates install w/no problem. It downloads and say that the installation was successful, but then you need to restart. When it restarts it goes through a series