What exception should I use when commit work fails ?

hi all:
    I create a class with methods to insert , modify and delete trasaction data, 
when commit work fails, I want to throw an exception, what exception should I use
for this case?

In general, you should do your commit using CALL FUNCTION IN UPDATE TASK. As this runs in a different process, you will never be able to catch an exception in your main task, even if you throw one in the Open SQL code. What you should do is carefully validate your data before posting it to the database, so that commit cannot fail for data integrity reasons. If it fails for technical reasons (DB down etc.) there is nothing that your code could do about it anyway, so in this case even getting an exception would be no use. What exactly is it you are trying to accomplish?
-- Sebastian

Similar Messages

  • What exception should I use?

    Hi, all:
    I am trying to learn how to use Exceptions, and I'd like some advice: in the network I'm creating, each node should have 4 edges--one to each neighbor in the north, south, east, and west. I want to create an exception if a given node has more or less than 4 edges, and I'm not sure which one to use. Here's the code:
                   for (int k = 0; k < networkList.size(); k++) {
                        int edgeAmount = node.getOutDegree();
                        if (edgeAmount > 4 || edgeAmount < 4) {
                             throw new OutOfBoundsException;//this can't be right.  What exception do I use?
                   }

    duffymo wrote:
    if you're talking about a network, you have nodes and connections. your requirement for four outgoing on each node is correct for all interior nodes. but what about edge conditions? a node on a free edge could have only three (north, south, and east for a node on a western boundary); a corner will have only two. if you're doing a network, is it impossible to have a node with only one connection to the rest, tethering it to the network?
    you might want to think again about the boundary conditions.
    %Rats. You're absolutely right. My problem is that I'm trying to create a square lattice network with no wraparound; you're right, the corners have two edges, etc, etc. The method I'm using to generate that network is creating random edges instead of the NSEW edges I need. Here's the method I generate the network in:
         public static List <Node> makeMyNetwork(int cols, int rows, boolean wrapAround, int connectRadius,
                   double rewireProb, Class <Node> node, Class <Edge> edge) {
              List <Node> list = null;
              list = NetworkFactory.createSquareLatticeNetwork(cols, rows, wrapAround, connectRadius,
                        node, edge);          
              ArrayList <Node> network = new ArrayList <Node> (NetUtilities.randomRewireSymmetric(list, rewireProb));
              return network;
         }It's "createSquareLatticeNetwork" that's giving me the headache. I tracked down the source code for it, it's located here: http://www.koders.com/java/fid53298D42795CCEFA9EE3BBCF18A170E6A3976274.aspx?s=squarelatticenet#L42
    My issue is this: how can I force it to create edges ONLY to its neighbors on the top, bottom, right, and left (and if on the outside, only to the other nodes in the lattice)?

  • What PPI should I use when exporting for a video project?

    I shoot RAW photos.  I like and use Premier Elements 11 to make video.  Frequently I insert photos in the videos and enjoy using the Pan and Zoom technique (frequently credited to Ken Burns).
    Resizing photos helps Premier Elements to run smoothly.  The LR Export command makes it easy.  Using PSD files works well in Premier Elements.  However, I am confused about settings.
    My understanding is that if no Pan&Zoom or cropping is to be done in the video the export should be 1920x1080.  If Pan&Zoom is planned, the setting should be higher by about 50%.  LR makes it simple by letting you specify the "Long Edge" so the setting would be 2880.   The short edge will match the original. 
    What about "Pixels Per Inch" for a HD 1920x1080 video project that may be played on a big HD TV or smaller YouTube?  There is plenty of information about PPI for printing and computer monitors, but not HD Video. 
    Here is screen capture for reference:
    What should the pixels per inch be set at to match 1920x1080 video?  The 140 setting is a complete guess!
    Thanks in advance!
    Bill

    whsprague wrote:
    My understanding is that if no Pan&Zoom or cropping is to be done in the video the export should be 1920x1080.  If Pan&Zoom is planned, the setting should be higher by about 50%.  LR makes it simple by letting you specify the "Long Edge" so the setting would be 2880.   The short edge will match the original. 
    The above sentence from your first post is the correct answer with a few changes as to what settings you need to use in LR's Export module.
    Anytime you "resize" an image it will lose sharpness unless you apply Output Sharpening. I have no idea if Premier Elements applies sharpening, how much it applies, or how much using large raw images slows it down. The best suggestion is for YOU to resize the raw images and apply Output Sharpening that meets YOUR taste as to "crispness." That way Premier Elements will use the properly sized TIFF or JPEG images (no PNG Export in LR) with no further modifications.
    For 1080p (1920 x 1080) Videos:
    Don't use the 'Long Edge' option in LR's Export module since you want both portrait and Landscape images to have the same height. Instead simply enter W: 1920, H: 1080, and Resolution as mentioned doesn't matter. For the Output Sharpening LR's Screen Standard setting should work fine, but review the resized images at 1:1 and adjust to your taste. LR's Develop module Sharpening settings should NOT be used for this purpose. This is for the initial "capture" sharpening only.
    As you mentioned when using Zoom & Pan you will want to increase the file size proportional to the actual Zoom setting you are using inside Premier Elements:
    150% = 2880 x 1620
    200% = 3840 x 2160
    300% = 5760 x 3240
    For best results I'd limit your Zoom to 150%, especially if you’re having performance issues. You also don't want to make your image larger than its native camera raw resolution, which will reduce the sharpness. For higher Zoom settings simply Export the images full-size without using ‘Image Sizing’ or ‘Output Sharpening.’ Use 'File Settings' JPEG, sRGB, with 80 Quality setting, which will provide good results.

  • What settings should i use when creating a wallet???

    Dear sirs...
    i configured the http server to use ssl. using the default wallet it works fine. now i created a certificate request , send it, get the certificate & added it into the wallet, enabled autologin feature, and then make the httpd.conf file point to it. now i can not see my site on the server. by only changing the wallet with the old one, i get the site working again.
    i guess the problem is in the certificate, so what should i check when installing the certificate? is there a limit on key size supported by oracle? should i add a specific cipher suite? how? can anyone tell me where to find a step by step example on using ssl?? (as i told you before, the problem in the wallet)
    thanks for any help
    best regards

    First try doing the following:
    In the Application tier home go to webcache/wallets/default
    Make a copy of the certificates there and then paste ur own certificates. See it might work.
    As for the step by step procedure here is the link:
    http://download-uk.oracle.com/docs/cd/B15595_01/collab.101/b14489/toc.htm
    Regards.

  • What user should be used when importing a Power Pivot model into SSAS tabular?

    I created a Power Pivot model using my own userid.
    In SSDT I can import that model but it saves the model in my own My Documents folder. In SSMS, other users can browse the data in that model.
    If I tell SSDT to save the model in the Public user's My Documents, the model is not visible in SSMS for anyone to see.
    If a colleague imports the model, it can be seen in SSMS but there is no data when it is browsed.
    There seems to be a tie up with the user id I used when the model was first created. Is it possible to break that link, or should we have a user id specifically for creating and deploying Power BI models via SSAS tabular?
    Propdev

    inputComboboxListOfValues
    selectOneChoice
    inputListOfValues

  • What dpi should I use when making a file for a HD (1920x1080px) in Photoshop??

    I am making a graphic for an HD (1920x1080px) in Photoshop and I wanted to know which dpi Should I use? 72dpi?100dpi?300dpi?
    I dont want this to bee seen bad in a big screen...=S
    Thanks in Advance,
    Orangejuice.-

    PPI only applies to print. Don't set it to anything.
    Photoshop defaults to 72 but the number is irrelevant for screen design.

  • What settings should I use when working with video from a minidv?

    I'm recording with a panasonic ag-dvc7 and eddeting on cs5 and would like to get the best quality on video. Im new to all this so I really don't know haw to set up the settings when starting the project.

    Well, the easiest way would be to simply drag the video file to the new item icon in your bin, and PrPro will automatically create a timeline that best fits your video. However, doing so won't actually teach you anything about it. If you're wanting to actually learn the ins-and-outs, then start doing some googling about codecs, wrappers, video standards, etc.
    From a minidv tape, you'll probably be safe manually picking one of the NTSC presets (unless you're in Europe, in which case it would be a PAL preset). Chances are you're shooting 29.97fps, though it might be 23.976, so you should check the properties of your video file in PrPro to see which it is. You'll either be in wide screen (16:9) or standard (4:3) so you'll need to pick which of those you want as well.
    When you start getting into HD footage, it gets a lot more complicated--SD is fairly easy.

  • HT5622 What information should I use when asked for "Label" when attempting to order an iphoto book?

    When attempting to purchase an iphoto book, I am unable to.  It tells me that the Label name is already being used.  I've used my name, and don't know what else I am supposed to do.  I don't want to lose the work I did to create the book, but Apple won't allow me to get to Step 3 in my purchase attempt.

    When attempting to purchase an iphoto book, I am unable to.  It tells me that the Label name is already being used.  I've used my name, and don't know what else I am supposed to do.  I don't want to lose the work I did to create the book, but Apple won't allow me to get to Step 3 in my purchase attempt.

  • What component Should I use?, Jpanel doesn't work

    Hi
    I need a program that has a window that can go fullscreen and windowed (I did that with a Jframe in fullscreen mode with a jpnale and a 800x600 Jpanel and destroying them with an object that maneges them), I did it with a jframe that contained a Jpanel, I used a Jpanel to avoid the flickering on the screen but I also need to change the font type and the font size, but the setFont on the Jpanel doesn't change the font (as I have realized and also read here [http://forum.java.sun.com/thread.jspa?forumID=257&threadID=150588] ), so I'm lost, I might have to redo the whole thing, but I just wanted to know what component should I use for a window that is going to have custom graphics and need diffrent fonts and diffrent font sizes and work in fullscreen without flickering
    Thank you for your attention, I would aprecciate any help given

    for example:
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.RenderingHints;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JSlider;
    import javax.swing.event.ChangeEvent;
    import javax.swing.event.ChangeListener;
    public class JPanelFont extends JPanel
      private Font font = getFont();
      private String myString = "Fubars Rule";
      private int fontSize = font.getSize();
      private JSlider slider = new JSlider(0, 100, fontSize);
      public JPanelFont()
        setPreferredSize(new Dimension(620, 250));
        setLayout(new BorderLayout());
        JPanel inputPanel = createInputPanel();
        add(inputPanel, BorderLayout.SOUTH);
      private JPanel createInputPanel()
        JPanel ip = new JPanel();
        slider.setMajorTickSpacing(20);
        slider.setMinorTickSpacing(5);
        slider.setPaintTicks(true);
        slider.setPaintLabels(true);
        ip.add(slider);
        slider.addChangeListener(new ChangeListener()
          public void stateChanged(ChangeEvent evt)
            fontSize = (Integer)slider.getValue();
            repaint();
        return ip;
      @Override
      protected void paintComponent(Graphics g)
        Graphics2D g2 = (Graphics2D)g;
        Object originalHint = g2.getRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING);
        g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        super.paintComponent(g2);
        myPaint(g2);
        g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, originalHint);
      private void myPaint(Graphics2D g2)
        font = font.deriveFont(Font.BOLD, fontSize);
        g2.setFont(font);
        g2.drawString(myString, 20, 100);
      private static void createAndShowUI()
        JFrame frame = new JFrame("Dynamic JPanel Font");
        frame.getContentPane().add(new JPanelFont());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      public static void main(String[] args)
        java.awt.EventQueue.invokeLater(new Runnable()
          public void run()
            createAndShowUI();
    }Edited by: Encephalopathic on May 21, 2008 9:18 PM

  • HT201376 How do I go about unlocking a recovery HD? Also I need to know what disk image should I use when trying to restore a failed(erased) disk in DU?

    Also I need to know what disk image should I use when trying to restore a failed(erased) disk in DU?

    You need to plug it into your computer running iTunes and restore it. Have you tried that? If so, what happened?

  • I feel I must move beyond iMovie, what program should I use ?

    I have been happily using iMovie and iDVD from versions 1 through 6.  iMovie 08 was so bad that Apple made iMovie 06 available as a free download for buyers of iMovie 08. The newer iMovies were better, but they seemed “dumbed down” (even for me).  Now, I am shocked and horrified to learn that the latest iMovie does not even set chapter markers!
    So, I have continued to use iMovie 06 and iDVD 08 (they seem to work fine under OS 10.9.4).   iMovie 06 is now 8 years old!  I feel compelled to move forward. A lot of my work is DV.    In the past, most of my source material came out of S-Video.   I used a Canopus ADVC300 analog-to-digital converter that gave good results.   Going forward, I will have more video utilizing Component Video, or HDMI.
    I am looking into 2 possibilities,  Adobe Premiere elements 12, or.........Final Cut Pro X.
    The final result of my work is almost always a DVD.   It is hard for me to move from iMovie and iDVD.  I never read the manuals for either program, yet,  I was able to produce DVDs with nice menus and overall quality close to Hollywood.
    It looks like Final Cut Pro X 'can' make a DVD directly without other software.  However, from what I have seen on YouTube the result is primitive compared to what iDVD was doing 10 years ago.
    Adobe Premiere elements 12 can make nice DVDs and Blu-ray's directly.  I have no problem with using a separate program to make DVDs but I haven't got a clue how to do that with Final Cut Pro X.   I suppose I can still use iDVD, but now I'm back to using discontinued software.
    I do not need any of the high-powered affects capability that Final Cut Pro X  possesses.  My “movie-making” is mostly confined to simple editing (the old iMovie 06 did all I needed).
    Frankly, one motivation for choosing Final Cut Pro X, is the excellent, compassionate and understanding support that the kind people on this very forum provide.  So, what program should I use?

    Ziatron wrote:
    ...  I am shocked and horrified to learn that the latest iMovie does not even set chapter markers!
    .. I am looking into 2 possibilities,  Adobe Premiere elements 12, or.........Final Cut Pro X.
    The final result of my work is almost always a DVD. ...
    ... I do not need any of the high-powered affects capability that Final Cut Pro X  possesses.  My “movie-making” is mostly confined to simple editing (the old iMovie 06 did all I needed).
    to turn perspective for a second by 180°:
    Why do you want to switch to a new editor anyhow?
    • iM-a never did discs - that was iDVDs job = no big change in your workflow
    • iDVD is still working, and aside obsolete, complex and $$$$ DVDSP (part of obsolete FC/p) or Encore (part of Adobes CC rent package) your only option left to create disks on MacOS is indeed iDVD (...ok, there's Toast and Burn and some weird 'shareware'-stuff...)..
    • iMovie-b supports the new HDef formats (AVCHD) - you mentioned converters and DVDs = no HDef in use, in your habitat, correct?
    • if you don't need FCPX' bling-bling (I can't imagine that ) - why not using FCPX-lite = iMovie? 15$ ...
    • chapters could be done in iDVD - just to mention that ............
    • AP and FCPX are following very different concepts in usage - my personal preference is 200% on FCPX, … I was one of the loudest nay-sayers, when iM08 araised, meanwhile, FCPX is my dream!! AP (tested it) is way too complex, crowded, 'optionalized' and did I mention 'complex' for me. A bit like Windows vs. MacOS: 'everything goes' (incl. getting lost) vs. 'convenience' (incl. restrictions) ... After 2y of practice, I'm editing my weekly hobby-projects with 6-cam-Multicam, incl. tons of  custom graphics, slow-mow, effects (soccer games) in less than 2h ... awesome!
    summary:
    • why switching?
    • use iMovie10 + iDVD
    • Premiere (or Premiere Elements!) and FCPX are both avail as fee trial ... test  it - but you need iDVD anyhow
    • 'disks'  is a dwindling niché, for years!- consider to switch to 'other' distribution options
    ... what are 'chapters' anyhow??... (kid din'!)

  • What backend should be used?

    well i m developing a card game in java.
    i would like to know for saving the game settings like the cards and variables of the game what backend should i use. i want the application to be fully platform independent and also dont want to use any proprietory s/w like ms access.
    should i store it in a txt/dat file or is there any such compatible db; not talking abt full fledged server kinda dbms like oracle or sql server. just a basic dbms s/w for a small need like this.
    thanx

    It really depends on the scope of the game. Will this be played on the web by many people at a time? Or is this more of a single player desktop app?
    For a dbms MySQL is a free, easy to install and light weight solution. This is my usual go-to light weight dbms.
    Outside of a database, one option is to serialize the objects that contain the states in which you want to save such as player info, card in players hand, and cards in the deck. You just need to make sure those classes implement the Serializable Interface. When the player saves or exits the game, the objects will be serialized saving their state. When the player is ready to start the game again you can deserialize those objects back into java objects on the stack with the same state they had when they were serialized.
    Take a look at the "Serializable" class on the documentation page here [url http://download.oracle.com/javase/6/docs/api/index.html]http://download.oracle.com/javase/6/docs/api/index.html. It is in the Java.io package.
    If you want a Java based DB that is super light wait (very little functionality), can be distributed with your game app, and completely platform independent you can take a look at SmallSQL [url http://www.smallsql.de/]http://www.smallsql.de/. I have not used this one myself but it might do the job you are looking for as well.
    Again, choosing between a DB and data file/serialized objects as well as choosing which DB you should use will depend on the scope of the game. If you are hosting the game, a DB like MySQL will work great. If it is a desktop app than serialization of object or distributing the SmallSQL java DB with you app might be the better choice.
    Edited by: JDScoot on May 15, 2011 12:05 PM

  • What query should I use to find all versions of Office 2013 64-bit installed on client computers?

    What query should I use to find all versions of Office 2013 64-bit installed on client computers? Could someone create a custom query? I need all of the client computers names and which ones have any Office 64-bit components. Thank you so much! I really
    appreciate it!

    Hi,
    You could edit the following query to meet your requirement.
    SELECT     dbo.v_R_System.Name0, dbo.v_GS_OPERATING_SYSTEM.Caption0 AS [Operating System],
                          dbo.v_GS_OPERATING_SYSTEM.CSDVersion0 AS [OS Service Pack], arp.DisplayName0,
                          CASE WHEN arp.version0 LIKE '11.0.6361.0' THEN 'SP1' WHEN arp.version0 LIKE '11.0.7969.0' THEN 'SP2' WHEN arp.version0 LIKE '11.0.8173.0'
    THEN 'SP3' WHEN
                           arp.version0 LIKE '12.0.6215.1000' THEN 'SP1' WHEN arp.version0 LIKE '12.0.6425.1000' THEN 'SP2' WHEN arp.version0 LIKE '14.0.6029.1000'
    THEN 'SP1' ELSE '' END
                           AS 'Service Pack', arp.Version0
    FROM         dbo.v_Add_Remove_Programs AS arp INNER JOIN
                          dbo.v_R_System ON arp.ResourceID = dbo.v_R_System.ResourceID INNER JOIN
                          dbo.v_RA_System_SMSInstalledSites AS ASSG ON dbo.v_R_System.ResourceID = ASSG.ResourceID INNER JOIN
                          dbo.v_GS_OPERATING_SYSTEM ON dbo.v_R_System.ResourceID = dbo.v_GS_OPERATING_SYSTEM.ResourceID
    WHERE     (arp.DisplayName0 LIKE '%Microsoft Office%edition%' OR
                          arp.DisplayName0 LIKE '%Microsoft Office Standard 2007%' OR
                          arp.DisplayName0 LIKE '%Microsoft Office Enterprise 2007%' OR
                          arp.DisplayName0 LIKE '%Microsoft Office Professional%2007%' OR
                          arp.DisplayName0 LIKE '%Microsoft Office Standard 2010%' OR
                          arp.DisplayName0 LIKE '%Microsoft Office Enterprise 2010%' OR
                          arp.DisplayName0 LIKE '%Microsoft Office Professional%2010%' OR
                          arp.DisplayName0 LIKE 'Microsoft Office 2000%' OR
                          arp.DisplayName0 LIKE 'Microsoft Office XP%') AND (arp.DisplayName0 NOT LIKE '%update%') AND
                          (arp.DisplayName0 NOT LIKE '%Microsoft Office XP Web Components') AND (dbo.v_R_System.Operating_System_Name_and0 NOT LIKE '%server%')
    AND
                          (arp.InstallDate0 NOT LIKE 'NULL')
    ORDER BY dbo.v_R_System.Name0, arp.DisplayName0, arp.Version0
    Full details:http://social.technet.microsoft.com/Forums/systemcenter/en-US/7baeb348-fb63-4115-8d76-2c884d18f708/sql-query-to-check-ms-office-service-pack-level?forum=configmgrreporting
    Best Regards,
    Joyce
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • I want to format my hard drive so i can have files bigger than 4GB what format should I use?

    I have a new hard drive that I want to format so it will work with both mac and PC (windows) but I have files that are bigger than 4GB, what format should I use?
    It needs to work with both PC and mac because I need to go between two computers etc

    If both of these computers are connect to the same router, both are in your home or place of work (Both are in the same location), it is very easy to Network them so you don't have to use DropBox or the external drive to share files between them.
    MickAUS2012 wrote:
    yea thanks for that,  i have drop box so i use that for some of my smaller files. Im just new to the mac so this is all a learning experince thanks for all your help everyone!

  • What setting should I use for Abbey Road drums?  Getting a cpu overload issue

    What setting should I use for Abbey Road drums (i.e. multi-output, stereo, etc)?  Getting a cpu overload issue.  I have a macbook pro, 4 gb ram, running Logic Pro 9.  Just 3 tracks of drums and a few real instrument tracks.  Can't find a guide in the manual for either Kontakt or Logic.  Thanks in advance!

    Hi
    AR drums are complete resource (CPU) hogs. They work better if you turn off as many of the AR internal plugins as you can.
    See section 4 (?) of the AR manual, which you can find within Kontakt (In the library area of Kontakt click hold the small "i" on the right of the "AR drummer" Library).
    Alternatively, your only solution is to increase the I/O buffer in Preferences:Audio, with the associated increase in latency
    CCT

Maybe you are looking for

  • How can i move my iphoto library from my desktop

    Hi all I recently had a problem with iPhoto 11, when it stopped responding, and during the following weeks trying to get it going again I copied my iPhoto library to my desktop so as to try different things but not damage my photos, well in the end I

  • Playing tunes in a playlist in random order

    How does one set music in a playlist to play in random order (is that the same as 'shuffle'?) Within my various playlists I've set them all to be 'shuffle' by clicking on the shuffle button in the bottom-left of the itunes screen (the button turns bl

  • DNS issue on Windows SBS2008

    Since few weeks, some websites are suddently unavailable. We are getting a 404 - The web page requested cannot be displayed. Basically, the only way to fix this is when I restart the DNS client/server on the server. The server is up to date but I did

  • Alpha Conversion Issue

    Hi Experts, where we can place the ALPHA conversion of "Customer Operational Contract" instead of on InfoObject level ? Please suggest me the other way to put alpha conversion.....

  • Ipod is recognized, but ipod name and files wont appear

    I have my ipod on my home computer and it works fine, but at my other computer when i plug the ipod in an ipod appears on in the detail, but it reads "system" instead of my ipod name, and none of the files contained in my ipod appear in the listing.