Using datasources: How to manage transactions when perform. update/insert?

I've been trying to find information on how datasources manage transacctions but I've been unable to find much information. I've read that for XA datasources you dont have to commit, save and rollback manually, but how are transactions managed for non-XA datasouces?+ I've only seen examples with select statements, such as in the example on this page [this page|http://developers.sun.com/jscreator/reference/techart/2/jdbc.html], but I've never seen a working example with insert and updates.
Can anyone point me to some examples?*
Also, when I use the DriverManager instead of the DataSource for doing updates/inserts I use the setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE) method. Can that be used with datasources?+
Thank you <img class="emoticon" src="images/emoticons/laugh.gif" border="0" alt="" />

If you are using a connection pool, how are you guaranteeing that you are using the same connection throughout the same application? Look at the following:
1) You grab a connection from the pool
2) You call procedure A
3) You call procedure B and issue rollback in procedure
4) You call procedure C
5) You close your connection
Are you saying you made changes in procedure A and when you issued a hard rollback in procedure B, the changes in A were not rolled back?
I'm guessing the problem is that you are not issuing your statements using the same connection.

Similar Messages

  • How to manage downloads, when you have Internet Download Manager installed

    How to manage downloads,
    When you have Internet Download Manager installed.
    Downloads through Firefox do not show, in Windows 7 & Windows 8.1
    Can this be fixed??
    If not how can I remove Downloads in Firefox

    Integrate IDM with Firefox
    *http://www.internetdownloadmanager.com/support/firefox_integration.html

  • How to perform UPDATE/INSERT

    Hi,
    How can i perform update/insert we do in OWB, which insert records if they are not available in target and updates them if they already exists.
    I am now using IKM Oracle Incremental Update(MERGE)
    but i am getting some error while execute
    VSG

    Here is the error.
    com.sunopsis.core.SnpsInexistantObjectException: There is no connection for this logical schema/context pair:RDDM_LOGICAL / STGDW_LOGICAL
         at com.sunopsis.dwg.dbobj.SnpConnect.getSnpConnectByLSchemaNameAndContext(SnpConnect.java)
         at com.sunopsis.dwg.dbobj.SnpConnect.getSnpConnect(SnpConnect.java)
         at com.sunopsis.dwg.dbobj.SnpSession.getDwgConnectLst(SnpSession.java)
         at com.sunopsis.dwg.dbobj.SnpSession.getConLst(SnpSession.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)

  • If i buy CS6 master collection and install it on my mac,can i use it on a new mac when i update?

    if i buy CS6 master collection and install it on my mac,can i use it on a new mac when i update?

    You're welcome. I'm glad I could help.
    Have a great day! 
    Gene

  • Contaner managed transaction, when XA transaction completed?

    Hi,
    I used container managed transaction. And i wanna understand when a XA transaction is considered "started" and when it is "ended" ?
    suppose, the application flow is:
    from JSF GUI -> Managed Bean -> JMS -> EJB -> Database.
    is there any differences if the application flow like this:
    from JSF GUI -> Managed Bean -> JMS1 -> EJB -> JMS2 -> EJB -> JMS3 -> Database.
    How many XA transactions are there in this case?
    Could you suggest if there is around tutorial to start with XA transaction?
    thanks,
    Edited by: CardM on Nov 2, 2012 12:38 AM

    CardM wrote:
    Hi,
    I used container managed transaction. And i wanna understand when a XA transaction is considered "started" and when it is "ended" ?
    suppose, the application flow is:
    from JSF GUI -> Managed Bean -> JMS -> EJB -> Database.Those are at least two isolated transactions. Everything up to and including sending a message and everything upon receiving one. Likely the transactions happen in two different and isolated containers too.

  • How do I no when to update my iPod nano

    How do I know when my I pod needs updating? And on the Nike app can I get it to work for cycling?

    As you connect you ipod to iTunes, it will prompt the need for updating. As for the nike app installed in the ipod, the available workout is only for run and walk. Cheers!

  • * * Procedure needs a way to  perform  update, insert or delete to...

    Hi Gurus,
    I got Assignment & need your help how to write this procedure efficiently.
    ** The procedure needs a way to actually perform the update, insert or delete to bring the reference data up-to-date with the refresh table.**These columns are for internal use and should not be compared to the refresh tables.
    Column 1
    Column 4
    Column 5
    Column 7
    Column 9
    Column 12
    Column 22
    Column 24
    1)     I would list out the columns in the cursors in place of the *. Or better define a record with %ROWTYPE.
    2)     You will need to include a way to look for rows that may be in one table and not the other.
    a.     Insert the rows that exist in the refresh table, but are missing from the reference table.
    b.     Delete the rows that are found in the reference table, but do not appear in the refresh table.
    3)     You also need to provide for handling the expiration date. Our default expiration date is ‘01-JAN-2500’, meaning if the refresh table has a futuristic expiration date or null, then our default expiration date is considered valid. Also this date needs to be added to any new rows created as a result of the refresh, if you leave the EXPIRATION_DATE column out of the insert it should default to the above date.
    4)     I assume that Differences is where you plan to list the actual data values that differ. If you don’t list the whole row I would at least list the primary key, in addition to what columns are different.
    5)     The procedure needs a way to actually perform the update, insert or delete to bring the reference data up-to-date with the refresh table.
    Thanks in advance

    Hi,
    Take a look at merge
    http://www.psoug.org/reference/merge.html
    Keep Smiling
    Bob R

  • How to manage transactions in pl/sql instead of java

    Hi,
    I have created a pl/sql package with a number of procedures and functions. In one of the functions I'd like to manage the transaction, instead of the jdbc driver. The function is something like:
    update <table> set <column>=<value>
    update <table> set <column>=<value>
    update <table> set <column>=<value> where status=2
    updatecount = sql%rowcount
    if (updatecount = 0) then
    rollback;
    return 0;
    end
    commit;
    Now if the last update results in a sql%rowcount being 0 than I want to rollback the entire transaction otherwise a commit is issued.
    When I execute this function through a java class which connect with a jdbc driver, it turns out that even though the last update has an updatecount of 0 the rollback is not performed. It looks like the jdbc driver takes over the transaction management. I've tried setting connection.setAutoCommit(false), but get same result. I've also checked the transaction isolation level, which is read committed.
    What am I doing wrong and how can I defer the transaction management to the function in question.
    Chaime

    If you are using a connection pool, how are you guaranteeing that you are using the same connection throughout the same application? Look at the following:
    1) You grab a connection from the pool
    2) You call procedure A
    3) You call procedure B and issue rollback in procedure
    4) You call procedure C
    5) You close your connection
    Are you saying you made changes in procedure A and when you issued a hard rollback in procedure B, the changes in A were not rolled back?
    I'm guessing the problem is that you are not issuing your statements using the same connection.

  • How to manage library when computer HD is smaller then Ipod HD??

    There has to be a way that I can manually manage my music etc without filling up my PC HD. I just got this Ipod and already I am out of disk space on my PC (ok, so its only a 20GB HD). What am I missing? Can't I copy CDs then import them to the Ipod and delete them from my PC?? Any help?

    You can delete songs from your iTunes/computer hard drive after transferring them to the iPod, and for this you need to set your iPod to manage the songs manually.
    However, this is an extremely risky option because when (and not if) there comes a time to restore your iPod, which is a very common fix for iPod problems, then all the music would be erased. If you no longer have the music in iTunes (or any other back up), then all that music would be lost.
    What if the iPod were lost/stolen/needed repair? Again, the music would lost. I strongly recommend a back up, and if computer hard drive space is in short supply, you should seriously consider an external hard drive. They are not expensive, and the cost is well worth it when compared to the loss of all your precious music.
    At the very least back up your music to either cd or dvd before deleting it, particularly any purchased music/videos, as this would have to be bought again if it were lost. See this.
    How to back up your media in iTunes.
    The iPod is not reliable enough to use it as a long term storage device, and these forums are littered with posts from people who decided to use it as such and ended up losing all their music.

  • How to handle transactions when two different databases are involved.

    consider two tables namely Table-A and Table-B part of two different databases namely ORACLE and MYSQL.
    Now the project requirement is updating the Table-A(ORACLE) and Table-B (MYSQL) as one transaction. i.e. either update both the tables or rollback both the tables.
    Now my question is how could i handle this situation using JDBC(Type-4) driver.Because i think at a time only one JDBC driver can be loaded into the JVM.

    NareshAnkuskani wrote:
    Now my question is how could i handle this situation using JDBC(Type-4) driver.Because i think at a time only one JDBC driver can be loaded into the JVM.No, that is not true.
    But anyway, you need to use distributed (XA) transactions. i believe that the latest version (5.0) of mysql actually has support for XA transactions. you need to use a to setup a distributed transaction and attach the connections for the two databases to that transaction. then it should function as you desire.

  • A few questions about managing partitions when performing a recovery

    Hello everybody,
    I purchased an L505-13Z about to weeks ago for personal use and light audio editing work. In these two weeks I took the time to explore and test this computer's performance and found it suitable for my needs, as it withstands even havier audio work then I will need, as tested. I am really happy with this laptop! Anyway, few optimizations I did for the audio software have wiped some needed features of the computer, so I needed to install the OS again.. Basically, I was always used to have the system install only wiping the system drive, leaving the "D:Data" partition intact. I notice this isn't the case with system recovery, as after recovery, both system and data partitions were wiped. of course everything is backed up on an external drive, but every time I perform a recovery I will need to copy everything back from the backup drive? I missed the point of this - it's exactly like having all my data saved on the system partition.. What's the need for the data partition then?
    Is there a way to perform a recovery and leave the "Data" partition untouched?
    My second question is if it's possible to change the size of the partitions somehow? I think that it's a bit useless to have 230G of free space for the system partition. For my needs, 100G is enough, and I could use the remaining 130G for the Data partition, I don't know why the drive is just split in half by default... (I am aware that a partition size change must wipe ALL data on the drive).
    Thanks everybody in advance for any help!

    If you use HDD recovery procedure - http://aps2.toshiba-tro.de/kb0/HTD9102IR0000R01.htm - the structure and data on second partition will not be deleted.
    So, if you want to install OS using HDD recovery option you can move all important data from partition C to partition D.
    The whole HDD will be deleted if you use recovery DVDs for OS installation.
    You should not change partitions structure because it can have negative influence on further HDD recovery procedure. It can happen that recovering data will not be found anymore.
    Please note: second partition D is not some kind of recovery or system partition. It is normal and usual HDD partition. There is just saved Toshiba recovery image in folder called HDDRecovery.
    Best thing you can do, I done it too, is to enter properties for this folder and define it as invisible.
    You will not be irritated with this folder. It is there but you cannot see it and there is no way you can delete it somehow. Use this partition as usual. Create own folders, copy data there, simply do your usual work.
    More questions?

  • How to manage Banners when Applications are Down ?

    Hi folks,
    Whenever applications ( productions ) are brought down for some maintenance reasons , we wanted to display a banner to the users of the system keeping them informed with a message.
    Can anyone please tell us how to do that ?
    Regards
    Raghu

    865767 wrote:
    Hi folks,
    Whenever applications ( productions ) are brought down for some maintenance reasons , we wanted to display a banner to the users of the system keeping them informed with a message.
    Can anyone please tell us how to do that ?
    Regards
    RaghuPlease see old threads for similar topic/discussion -- https://forums.oracle.com/forums/search.jspa?threadID=&q=Maintenance+AND+Message&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • How to manage colors when printing on colored paper?

    I created a design with correct colors and of course when I do the "simulate colored paper" the colors are off (as expected), is there an easy way to alter the colors to match the original colors so that it prints correctly on the colored paper? I figured there might be a way to subtract the color of the paper from the object colors or something.  Any workflow help is greatly appreciated!

    Inks are transparent and the colours are subtractive, so I’m afraid that any amount of ‘correcting’ will never get you to where you want to go. The colours will always be tinted (or darkened) by the paper. However it may not be necessary to do anything. Take for example financial newspapers. They are often printed on pink paper yet after a time you start to stop noticing the pinkness and colour photos appear normal.

  • Someone stole my Ipod in school and I would like to know how to use the Ipod tracker that comes when you update your Ipod. Can someone please help me?

    Can you please help. The tracker comes with the update for the Ipod Touch with Camera

    There is no tracker application bundled with an iPod (nor iPhone nor iPad). Apple offers an app in the iTunes Store that allows an iOS device on which the "Find My..." service has been set up to be tracked from another iOS device (the app goes on the device doing the tracking). But the service has to have been set up on the device you want to track before it was stolen.
    http://www.apple.com/icloud/features/find-my.html

  • How to avoid deadlock when multithreading updates one table same time?

    Multithreading calls the stored procedure at the same time to update data in one table. For a instance,
    Table1
    Col1 Col2 Col3
    C1 1 1
    C1 2 2
    C1 3 3
    C2 1 1
    Table2
    Col1 Col2 Col3
    C1 1 10
    C1 2 4
    C1 3 3
    C2 1 1
    There are several steps I want:
    1. Get the data in Table1 where Col1 = C1 in a cursor which has Col1 column and Col2 column.
    2. Cycle them one by one, and get the Col3 data from Table2 where Col1 = C1 and Table2.Col2 = Table1.Col2. (Due to deadlock is my concern, we use temp table, definityly it is not a good way. :( )
    3. Update Table1 Set Col3 = Table2.Col3.
    My new idea is when I get the collection from Table1 which Col1 = C1, I use this way below.
    First I set transaction in below way.
    SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
    Then
    select * from Table1 where Col1 = C1 for update nowait;
    In my opinion, if one thread lock the data for update, other thread won't select out that locked data. Does it work?
    Thank you.
    Best regards,
    Andreas

    Why is the data submitted as a collection in the first place?
    A collection is great as a program data structure - dealing with program variables. It is a very poor choice to use it to deal with Oracle data in a CRUD fashion.
    The purpose, ito dealing with Oracle data, of a PL/SQL collection is for one thing and one thing only - context switching.
    To reduce the number of times you need to step out of PL/SQL and into the SQL engine in order to pass data from one to the other. A collection allows you a bigger buffer area and thus less context switches.
    And that's it.
    A client (Java, C#, etc) that submits data to Oracle to be CRUD via a collection is a design flaw. A collection resides in "expensive" dedicated, non-sharable and non-scalable server memory.
    In order to CRUD a collection, you either need to write bare bones feature methods yourself, or cast that collection into a SQL structure and use more powerful and flexible and feature rich SQL against it.
    Which then begs the question - why did the client not submit that data directly to the SQL engine, either into a permanent table or a temporary table?
    Performance and scalability are issues that need to be addressed at core design level. It is not something that can be tacked on and "fixed" after the fact. So you need to make very sure that your reasons for not wanting to use a temp table (for example), are valid and sound technical reasons.

Maybe you are looking for

  • Multiple columns and rows in MessageService

    I am attempting to create a message (via MessageService) which has multiple lines of data, and each line has multiple data columns. Background:  My program reads data from a web store, and creates Sales Orders in SBO.  A single run might process mult

  • Trying to use the Tour 9630 with Outlook 2003 Calendar, Memo/Notes & Tasks. Can't Config & Complete....

    I would like to use my Outlook 2003 with my Blackberry Tour 9630 to use the Calendar, Memo & Task features instead of entering everything on the BB. I use my Outlook Express 6 for my email input and output. The Outlook 2003 is not connected to the in

  • DB links in Data Services

    Hi all, Environment: Business Objects Data Services XI 3.0, Windows Server 2008 R2, Oracle 10g Problem Description: A DB link is defined from Oracle 10g database to another Oracle 10g Database. The tables from the second database can be accessed usin

  • Polk PSW10

    So I have an interesting question to ask to anyone that may have an answer.  I had purchased a pair of Polk Tsi100 speakers that I love.  The speakers are currently hooked up to a 2-Channel 100W JVC Receiver from 1988.  I am looking into adding a sub

  • Lost my contacts icon

    I was trying to rearrange my icons and accidentally lost my contacts icon.  When I search, it comes up but I can't tell where it is or how to get it back on my home screen.  (I'm running iOS 7.1.2 on a new iPhone 5.)