Exception handling that never ends...

Hi,
I've been putting the finishing touches on a project I'm working on, and right now I'm "fixing" some of the error handling. I realized that lots of times when I catch an exception, the program never returns to where it left off. Most of these errors would normally be fatal, but since it's important that this particular application does not terminate (ever) I basically just call a method in the main class that resets the application.
The problem, I'm thinking, is that java keeps a place on the stack to return to the statement after the error occurred -- and since this will never happen, I can imagine a lot of unnecessary placeholders eventually overflowing the stack. This would be bad since it's our plan to have this application running on our shop floor for days/months/years at a time with minimal intervention!
But I'm fairly new to java, and maybe I'm just paranoid. Is my understanding of this situation correct? Can I avoid it?
Thanks for any input.

Okay, here is some code. By the way, only on unrecoverable errors do I want to log the user off and reset the application. The reason I'm doing this is because 1) I don't want the application to exit 2) It's possible that the problem is with that particular users account, and the next user might be okay. This is an application running in a kiosk where people will be lining up to use it, and if it can at all stay up it ought to!
One final note before I paste in the code... My application is admittedly not as robust as it could be, but only because my database interface is really an XML API provided by a third-party. The API is limited, so there are only so many things I can do to recover from an error!
Ok, here's some code. It's not my actual application since that would be thousands of lines of code, but it's an example application I set up that illustrates my problem. It simulates a logon and tries to do 3 transactions but fails on the second one. At that point I would like it to simply "reset" itself for the next user and never do the third transaction, but the third transaction inevitably gets done. What do you think?
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class MainClass
     private class MyDialog extends JDialog implements ActionListener
          private JButton myButton = new JButton();
          MyDialog(String buttonText)
               this(null, buttonText, true, buttonText);
          public MyDialog(JFrame parent, String title, boolean modal, String buttonText)
               super(parent, title, modal);
               myButton.setText(buttonText);
               myButton.addActionListener(this);
               this.setSize(400,400);
               this.getContentPane().setLayout(new GridBagLayout());
               this.getContentPane().add(myButton);
          public void actionPerformed(ActionEvent e)
               this.hide();
     MyDialog logon = new MyDialog("Logon");
     MyDialog form = new MyDialog("Do some stuff");
     public MainClass()
     public static void main(String[] args)
          MainClass m = new MainClass();
          System.out.println("Logging on...");
          m.logon.show();
          System.out.println("Showing form...");
          m.form.show();
          for (int index = 1; index <= 3; index++)
               try
                    System.out.println("Doing transation " + index + "...");
                    m.doTransaction(index);
               } catch (Exception e)
                    System.out.println("Resetting due to error...");
                    m.reset();
          m.logoff();               
          System.exit(0);
     private void reset()
          logoff();
          System.out.println("Loggin on...");
          logon.show();
          System.out.println("Showing form...");
          form.show();
     private void doTransaction(int data) throws Exception
          System.out.println("Sending data to database...");
          //Simulate an error occurring
          if (data % 2 == 0)
               System.out.println("Error occurred!");
               throw new Exception();
     private void logoff()
          System.out.println("Logging off...");

Similar Messages

  • Csimport that never ends

    Good morning,
    I am trying to import an ics calendar.
    This calendar has been export with csexport.
    The csexport takes a few seconds.
    But the csimport never ends (after several hours).
    There are 8000 events.
    A truss an the process show almost no nothing except:
    truss -p 16176
    brk(0x01B92320) = 0
    brk(0x01BA4320) = 0
    brk(0x01BB6320) = 0
    brk(0x01BC8320) = 0
    brk(0x01BDA320) = 0
    brk(0x01BEC320) = 0
    I have open call 70642348 because I am stuck.
    Would you know what I could do else to to import this ics file
    or to trace the problem?
    Thanks in advance for your help.

    Hi,
    I do not have other system, but I can provide you the ics file.
    You should immediatly see my problem.
    What I have find out also is that if I export with csexport rather than uwc,
    I do not have this problem although the files are very similar.It might be good to provide both .ics files on the Sun support call -- the calendar exported from uwc, and exported using csexport.
    Thanks.
    --Wei Yee                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • The restore that never ends....Te​cra A4

    This is a continuing Saga...it's been a little over a month, and the owner/user (not me) is about to give up & buy another laptop to replace this one. Previous exchanges on this community are here:
    http://laptopforums.toshiba.com/t5/Windows-Vista-X​P-Win7-RC/HDD-Fact-Image-Restore-Hangs-at-end-2nd-​...
    http://laptopforums.toshiba.com/t5/General-Technol​ogy/Could-my-recovery-media-be-damaged-Would-new-m​...
    I had some good input by Techman & Defender, then for the last month have been struggling with Customer Service to get the disks I ordered. Long story, but in the end, they reversed charges to my CC...and by the time they got things to work in their system....I ended up getting 3 restore disks...the last one delivered today. Apparently they are switching over their parts order system to a new one, and my order was caught in the fray of that adventure.
    So now after doing many, many restores, I've come full circle and have exactly the same issues I had with the disks I created from the hidden hdd partition...where the "Applying Final Configuration" splashscreen  is up, Toshiba Assist is running per the Toshiba restore script, and the system freezes. There is no further disk activity, and the machine will only respond to a hard shutdown, by holding the power key. (did I mention how much I hate suspended fabric keys over hard micro keys on laptops?)
    I'm certain there is no activity on the drive when this freezes, as the drive activity light works fine on this machine, and when things freeze, there is never any drive activity shown, heard, or felt.
    The machine does not appear to be overheating, as the fan comes on every so often, but once things freeze up, the fan runs at a low constant speed, seemingly appropriate since the processor is doing little or nothing during the freeze.
    * Machine never seems to complete setup. Runs "Toshiba America Systems" setup routine 'successfully' once, then runs setup two. Then runs setup three? and goes into freeze mode.
    * Any time machine starts in Windows, it's freezes after about 1 or two minutes.
    * Freeze occurs regardless of mouse movement OR when machine is not touched.
    * Can only regain control of machine via hard power off.
    * Can run the machine in safe mode. There is no freeze up.
    * Can run the machine from a dos disk or BartPE. There is no freeze. Can keep it up for days without issue in these modes.
    * Have formatted entire volume from P/E, attempting to force out any disk issues.
    * Have run chkdsk /r from with no apparent change or fix
    * Have replaced memory in machine with no change in result.
    * Have run Fujitsu HDD utility from dos boot. Passed both quick & extensive tests.
    * Have run MemTest, completing 4 complete cycles on memory with no failures
    * Have run msconfig from safe mode, initiating minimal startup. When machine restarts in 'normal' Windows with minimal support, it still freezes after a minute or so.
    * Even Chkdsk, when run from normal startup stalls at 26/27 percent...about the 1 to 2 minutes time.
    * HOWEVER... Chkdsk is fine when run from BartPE disk.... chkdsk c: /r
    Any help or suggestion would be GREATLY appreciated...I've never been so throughly flummoxed by a small piece of hardware...
    SetiRich
    ...Lost in a restore cycle...
    Solved!
    Go to Solution.

    My only other suggestion is to check the memory on this unit.  Toshiba's are picky about getting good memory.  So my guess is this unit might have been upgraded.  Cehck the specs to see how much it comes with and see if there is more in it then that.  Remember some memory maybe on the bottom and some may be under the keyboard.
    I suspose a BIOS update might be worth it.  (I didn't have time to look at the old threads...)
    Otherwise ASP
    This signature left intentionally blank.

  • HT201272 about a year ago, I purchased music from iTunes.  The title was Welcome Back My Friends to the Show that Never Ends.  Ladies and Gentleman...Emerson, Lake and Palmer.  I have just bought a new computer with Win 8. Will not move from i Phone.

    As the heading states...I cant transfer this album purchase from my phone to my computer.  Only one song gets moved.
    All other titles of music has been transfered.  The Store tries to recharge me if I attempt to reload it on my computer,
    David Miles

    " When I did this, my library showed all the music I have "purchased" from itunes but did not have the music that I downloaded a long time ago through itunes from my old CDs."
    Correct.
    " How can I get that music to show up in my library now on my new computer?  "
    Copy it from your old computer or your backup copy of your old computer.
    The sync is one way - computer to ipod.

  • Random buffering that never ends [Flash/HTML5]

    So, interesting opportunity to learn something new! ;)
    What is wrong: buffering. At first I thought I have problems with Flash alone, but this isn't true. Any video [be it on Youtube or Twitch, Flash player or HTML5 player, doesn't matter] randomly will stop. I will see the buffer "icon" and... nothing happens. Ever. I can leave it for as long as I want, it will not budge.
    On Twitch.tv it's a bit different, it will pause the stream for a solid minute and then "restart" itself.
    Cleared cache, session files, updated Flash, used Ccleaner as well. Don't want to go through creating a new profile yet (a bit of a hassle), trying to figure out what might be causing the issue. As I said, it's very random, sometimes happens in short video on Youtube, sometimes I can watch long videos without much problem.
    And no, my internet is not the issue, double checked on that.
    Any ideas?

    '''[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode Start Firefox in Safe Mode]''' {web link}
    While you are in safe mode;
    Type '''about:preferences#advanced'''<Enter> in the address bar.
    Under '''Advanced,''' Select '''General.'''
    Look for and turn off '''Use Hardware Acceleration'''.
    Poke around safe web sites. Are there any problems?
    If you have problems with current Shockwave Flash plugin versions then check this:
    * see if there are updates for your graphics drive drivers
    '''https://support.mozilla.org/kb/upgrade-graphics-drivers-use-hardware-acceleration'''
    * disable protected mode in the Flash plugin (Flash 11.3+ on Windows Vista and later)
    '''https://forums.adobe.com/message/4468493#TemporaryWorkaround'''
    * disable hardware acceleration in the Flash plugin
    '''https://forums.adobe.com/thread/891337'''
    See also:
    * '''http://kb.mozillazine.org/Flash#Troubleshooting'''

  • Firefox has determined that the server my request for a webmail address refers in a way that never ends. How can I fix that?

    I wanted to use my web-mail on the server of my Internet provider. After trying to login I get the message I stated above.
    I have asked my Internet provider and they say it is a Firefox problem.

    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites causing problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    See:
    * http://kb.mozillazine.org/The_page_is_not_redirecting_properly

  • Freezing That Never Ends...

    I just got my Ipod exchanged at the apple store, so it should have no pre-existing problems with it. I just put songs on it and tried to disconnect it, but it froze. The screen isnt blinking like it should. I reset it and the same thing happens, If you reset then take it off computer it freezes in the menus. I tried to restore it to factory settings, and it worked after I set all of the updating to manual. now I put songs back on and the same thing keeps happening. Any ideas?

    If resetting and restoring don't help, I don't think you have much option but to return it yet again.

  • Exception Handling Confusion!

    I require the following very basic functionality from a function.
    Create or Replace function fnc_get_col3 (a in number, b in number)
    return number
    as
    begin
    return select col3 from TAB1 where col1 = a and col2 = b;
    end fnc_get_util;
    My question is that can I use the regular exception handling (like 'No data found' and 'Too many rows') in above function when i am using the return and select statement in same line
    OR do i have to recreate this function as
    Create or Replace function fnc_get_col3 (a in number, b in number)
    return number
    as
    abc number(5);
    begin
    select col3 into abc from TAB1 where col1 = a and col2 = b;
    return abc;
    exception
    when no data found then
    dbms_ouput.put_line 'No data found'
    end fnc_get_util;
    Thanks in Advance

    Why do you believe it is syntactically valid to return a value this way? The first function does not compile and cannot compile so there is no exception handling to discuss
    SQL> create or replace function f1
      2    return number
      3  is
      4  begin
      5    return select count(*) from emp;
      6  end;
      7  /
    Warning: Function created with compilation errors.
    SQL> sho err
    Errors for FUNCTION F1:
    LINE/COL ERROR
    5/10     PLS-00103: Encountered the symbol "SELECT" when expecting one of
             the following:
             ( - + ; case mod new not null <an identifier>
             <a double-quoted delimited-identifier> <a bind variable>
             continue avg count current exists max min prior sql stddev
             sum variance execute forall merge time timestamp interval
             date <a string literal with character set specification>
             <a number> <a single-quoted SQL string> pipe
             <an alternatively-quoted string literal with character set
             specification>
             <an alternYou would need your SELECT statement to select data into a local variable and to return that local variable as you are doing in your second implementation. It would not make sense, however, to have an exception handler that simply uses DBMS_OUTPUT to display a message-- you should only catch an exception if you can do something meaningful with it.
    Justin

  • Exception handling issue

    I have a perplexing question.... I am in the midst of developing an APEX 4.0 application. Customer will NOT be going to4.1 for a while....I wish to have exception handling that will handle both APEX based interactions and some back-end Sql Loader activity.
    I have built an Exception handler that has a supporting APEX page to display a more human compatible error page, but am trying to make the exception handler NOT try and call up a page and such if the exception it encounters is a trigger being fired when a # of rows are being bulked loaded..
    Simply put.. In the exception handler, how can I have code branch around the fact I might NOT have an APEX application for it to display the error ...
    What I'd love to find is an object or variable that tells me what I am running the PL/SQL under..
    Thank you,
    Tony Miller
    Dallas, Tx

    Jari,
    If I try running this from SQL Plus, I would assume it would crash due to fact I am NOT running under APEX and can NOT see the Application object that this function is based upon:
    IS_SESSION_VALID Function
    This function is a Boolean result obtained from executing the current application's authentication scheme to determine if a valid session exists. This function returns the Boolean result of the authentication scheme's page sentry.
    Its like trying to figure out which came 1st, the chicken or the egg...
    Thank you,
    Tony Miller
    Dallas, TX

  • Defensive programming vs exception handling

    Hi
    im new to java programming and having problems getting my head around defensive programming vs exception handling.
    i've read in my uni books about design by contract and the idea of defensive programming but im having problems with it.
    so say i write the code.
    String container = //some value
    if (container.equals.("")) // so if i am looking for a value and find a empty String
       throw new // a custom exception i have made for this error.
    else
       //do whatever i had planned with a non-empty String
    }is this Defensive programming or exception handling. Or am i complete of base.
    thanks

    jverd wrote:
    JustSomeGuy wrote:
    Don't fall into the trap of saying "Meh, the exception will handle it". If you can forsee something easily being a problem, and it can be controlled, then control it. Save the exception handling for those things you don't forsee and those you can't control. I disagree. Or at least, I disagree with what I think you're saying.
    For instance, if null is not a valid argument, then document it, and don't waste code defending against it. Either throw an explicit IllegalArgumentException, or let the NPE be thrown.
    And absolutely under no circumstances should you ever write code that will deliberately lead to an exception, Eh? If an exceptional condition occurs, you should delibrately throw an exception. Consider if you will the following code snippet
    import java.io.*;
    class ExceptionExample {
        public static void main(String[] args)
            throws IOException {
            if (args.length == 0) {
                System.out.println("Must give filename as first arg.");
                return;
            FileInputStream in;
            try {
                in = new FileInputStream(args[0]);
            catch (FileNotFoundException e) {
                System.out.println("Can't find file: " + args[0]);
                return;
            int ch;
            while ((ch = in.read()) != -1) {
                System.out.print((char) ch);
            System.out.println();
            in.close();
    } What I was saying in the first part is shown with the following part of the above code
    if (args.length == 0) {
       System.out.println("Must give filename as first arg.");
       return;
    } Would the exception handler that follows this peice of code have taken care of that? Sure! Would it be the best choice to just let the exception handler do it? No way no how!
    It is easy to forsee someone forgetting or not realizing they need to add the filename as an arg and it can be controlled, so in this and most cases just like it the best choice is to either inform the user with a more specific statement than could be used in the exceptionhandler and do nothing or fix it yourself like for instance by using a default filename.
    What I meant by deliberately throwing an exception can be illustrated with this small portion of my code above
    int ch;
    while ((ch = in.read()) != -1) {
        System.out.print((char) ch);
    } A -1 to mark the EOF is expected and reaching the EOF is expected. There is absolutely nothing abnormal about this, so it should not be handled by an exception. But far to often I have seen novice and especially "think they know it all novices" use an exception in place of exactly this. They know the file will end, they know they must do something about that, but instead of doing it right they just set it up so an exception will be thrown and they can just handle it in the exceptionhandler. This is what I meant by deliberately throwing exceptions, in that an exception must be thrown in order for their program to work as intended. Bad, very bad.
    Now that I have provided an example and further clarified my position do you still disagree? I can't imagine you would, so if you do I would be very interested in getting some further insight into your reasoning.
    JSG

  • Exception handling In File Adapter

    My requirement is that i am reading a file using file adapter but the file is not in correct format so it is not reading that file and even not making any bpel instance.
    so i need to add exception handling that show me the above error(file read failure).
    we have log file in that it is showing this error but i need to show that error on BPEL console.
    Please help how to proceed with this.
    Thanks
    Vivek Garg

    I am able to call another bpel when error occured in file reading Bpel.
    the second Bpel will handle the error and shows the error. but addition to that i need BPEL process name which fails(File Read BPEL) and call second BPEL.
    Thanks
    Vivek Garg

  • A never ending multiplayer game?

    Hi
    I want to make a 2d spaceship multiplayer game (applet). The game should have lots of human controlled spaceships (and maybe some computer controlled spaceships if there are no human players). Each time a new user starts a game in its web browser, a new spaceship will appear in the game. The user will play until his spaceship is shot by another player. A shot spaceship will disappear from the game, and the player may choose to start a new game with a new spaceship. But the game on the server should never end. Each user will play in the same game on the server (but there may be a maximum number of players).
    Is it possible to make a game that never ends? Which requirements apply to the server? Is it possible to use a normal web server (you have only FTP access to the server computer)?

    this is a fast extract from my files, when you run Gclient the server will be launched and 2 clients will be opend, the red boxes are players
    using the mouse you move the box, the change of location is propagate thru the server.
    Server
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class Gserver
         private int    players = 0;
         private Vector ones = new Vector();
    public Gserver() 
         ServerSocket servS;
         Socket       clnt;
         try
             servS = new ServerSocket(4444);
              System.out.println("Server Ready on port: 4444");
              while(true)
                   clnt = servS.accept();
                   System.out.println(""+clnt);
                   One one = new One(clnt);
                   one.start();
         catch (IOException ex) {System.out.println(""+ex);}
    public void sendToAll(String s)
         for (int i=0; i < ones.size(); i++)
              One one = (One)ones.get(i);
              one.write(s);
    public void sendToOne(One me)
         for (int i=0; i < ones.size(); i++)
              One one = (One)ones.get(i);
              me.write(one.data);
    public class One extends Thread
         private Socket         socket;
         private BufferedReader in;
         private PrintStream    out;
         public  String         data;
    public One(Socket socket)  
         this.socket = socket;
    public void run()
         try
              out  = new PrintStream(socket.getOutputStream());
              in   = new BufferedReader(new InputStreamReader(socket.getInputStream()));
              ones.add(this);
              players++;
              int x = players*30-25;
              data = "P"+players+","+x+","+x+",";
              sendToAll(data);
              sendToOne(this);
              while ((data = in.readLine()) != null)
                  sendToAll(data);
         catch (IOException e) {System.out.println("one!!"+e);}
         close();
         ones.remove(this);
    public void write(String s)
         if (out != null)
              out.println(s);
              out.flush();
    public void close()
         if (socket == null) return;
         try
              if (socket != null) socket.close();
              if (in     != null) in.close();
              if (out    != null) out.close();
         catch (IOException e){}
         socket = null;
         in     = null;
         out    = null;
    public static void main (String[] args) 
         new Gserver();
    client GUI
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.event.*;
    import java.util.*;
    public class Gclient extends JFrame implements KeyListener
         private Component me;
         private Container co;
         private Gsocket   socket;
    public Gclient()  
         super("Glient");
         setBounds(1,1,500,200);
         addWindowListener(new WindowAdapter()
        {     public void windowClosing(WindowEvent ev)
                   if (socket != null) socket.close();
                   dispose();     
                   System.exit(0);
         co = (Container)getContentPane();
         co.setLayout(null);
         co.setBackground(Color.black);
         addKeyListener(this);
         requestFocus();
         setVisible(true);
         if (socket == null)
              socket = new Gsocket(this);       
              if (!socket.isConnected())
                   dispose();     
                   System.exit(0);
              else socket.start();
    public void keyTyped(KeyEvent ke){}
    public void keyPressed(KeyEvent ke)
         int kc = ke.getKeyCode();
         if (me == null) return;
         Point o = me.getLocation();
         Point p = me.getLocation();
         if (kc == 40) p.y++;
         if (kc == 39) p.x++;
         if (kc == 38) p.y--;
         if (kc == 37) p.x--;
         if (!p.equals(o)) socket.write(me.getName()+","+p.x+","+p.y+",");
    public void keyReleased(KeyEvent ke){}
    public void go(String s)
         StringTokenizer tokn = new StringTokenizer(s.trim(),",");
         String p = tokn.nextToken();
         int    x = 0;
         int    y = 0;
         try
              x = Integer.parseInt(tokn.nextToken());
              y = Integer.parseInt(tokn.nextToken());
         catch(NumberFormatException e){}
         Component com = null;
         for (int i=0; i < co.getComponentCount(); i++)
              if (co.getComponent(i).getName().equals(p)) com = co.getComponent(i);
         if (com == null)
              JLabel l = new JLabel(p);     
              co.add(l);
              l.setName(p);
              l.setOpaque(true);
              l.setBackground(Color.red);
              l.setHorizontalAlignment(SwingConstants.CENTER);
              com = l;
              co.validate();
              if (me == null)
                   me=l;
                   setTitle(p);
         com.setLocation(x,y);
         co.repaint();
    public static void main (String[] args)
         Thread t = new Thread()
             public void run()
                   new Gserver();
         t.start();
         Gclient a = new Gclient();
         Gclient b = new Gclient();
         b.setLocation(b.getX(),b.getY()+220);
    client socket
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.util.*;
    import java.net.*;
    import java.io.*;
    public class Gsocket extends Thread
         private Gclient        client;
         public  String         host;//  = "10.20.2.58";
         private int            port  = 4444;
           private Socket         socket;
         private PrintStream    out;
         private BufferedReader in;
    public Gsocket(Gclient client)  
         this.client = client;
         port = 4444;
         try
              InetAddress ia = InetAddress.getLocalHost();
              host = ia.getHostName();
         catch (UnknownHostException ex)
         try
              socket = new Socket(host,port);
              out    = new PrintStream(socket.getOutputStream());
              in     = new BufferedReader(new InputStreamReader(socket.getInputStream()));
         catch(IOException ex)
              socket = null;
    public boolean isConnected()
         if (socket == null) return(false);
              else            return(true);
    public void run()
         try
              String data;
              while ((data = in.readLine()) != null)
                   client.go(data);
         catch(IOException ex)
         close();
    public void write(String s)
         out.println(s);
    public void close()
         try
              if (socket != null)     socket.close();
              if (in     != null) in.close();
              if (out    != null) out.close();
         catch (IOException e){}
         socket = null;
         in     = null;
         out    = null;
    }Noah

  • Job that never finishes in the Batch Apps Service?

    We have a job that never finishes, the single task that it runs says it's finished but the job never ends. I end up having to cancel it.
    The task that runs takes about 33 minutes or so to complete. Could whatever that monitors the job timeout waiting for the task to finish?
    here's the log that we see for the job
    2/25/2015 7:51:55 AM - (1) Completed task processing.
    2/25/2015 7:51:54 AM - (1) Finished uploading outputs to blob storage.
    2/25/2015 7:51:54 AM - (1) Uploading outputs to blob storage.
    2/25/2015 7:51:54 AM - (1) Task output 0 files
    2/25/2015 7:51:54 AM - (1) Completed external process.
    2/25/2015 7:19:18 AM - (1) Starting external process.
    2/25/2015 7:19:18 AM - (1) Completed assets download.
    2/25/2015 7:19:18 AM - (1) Downloading assets to local storage.
    2/25/2015 7:19:12 AM - (1) Starting task processing.
    2/25/2015 7:18:31 AM - (Job) Job splitter finished
    2/25/2015 7:18:23 AM - (Job) Job splitter started
    2/25/2015 7:18:12 AM - (Job) The job orchestrator started
    2/25/2015 7:13:05 AM - (Job) Using auto pool C14F1D31-BE60-4D02-9003-C05021B3C470
    2/25/2015 7:13:05 AM - (Job) Requesting Azure compute resources - this may take several minutes
    2/25/2015 7:13:03 AM - (Job) Job queued for processing
    2/25/2015 7:13:01 AM - (Job) Job request received

    Unfortunately, posting our code here really isn't possible.
    I can describe what we're doing and seeing.
    We're not using the batch service to run command line applications. In our task processor, we're determining what classes to create and call and call them in process.  We have a lot of job types (above 15 and counting) that we need to run, so we opted
    to combine them into a single class library and call them that way. None of our jobs output any files, all of our output get persisted to blob storage. We're using the batch service kind of as an on-demand cloud worker infrastructure. 
    It seems like the issue (jobs that never end) are random.  It's not always the same job and it's not always long running ones.  When the issue does crop up, our task completes without any errors. We do see the results of our jobs in blob storage.
     Also in our task processor, we set the TaskProcessResult's ProcessorOutput property to any messages we've logged.  We can download and see those log messages in the portal.
    We also see 2 tasks created for the job, our task and the default merge (we don't create merge tasks for our jobs).
    Would the job id's or logs help in any way?

  • Bypass exception handler?

    Hi!
    I have got serveral hundreds of stored procs calling one error handling proc in case of an error.
    Inside this error handling proc I have use the command "raise_application_error" to generate an error message for the user of our application. Unfortunately, the calling stored procs contain an exception handler that catches the generated exception.
    It's hardly possible to change hundreds of stored procs.
    So is there a mechanism to raise the exception and pass it to the application regardless of the exisitence of an exception handler?
    Yours, Heiko Kaschube

    Actually, the exception you raised shouldn't be caught in the calling stored procs except there's "WHEN OTHERS THEN" section to catch all the exceptions which are not caught by other sections. What you need to do is, in "WHEN OTHERS THEN" section, check the error code. If the error is generated by raise_application_error, then raise the error again.

  • Exception Handling Standards -The exception Exception should never been thrown. Always Subclass Exception and throw the subclassed Classes.

    In the current project my exception handling implementation is as follows :
    Exception Handling Layer wise :
    DL layer :
    catch (Exception ex)
    bool rethrow = ExceptionPolicy.HandleException(ex, "Ui Policy");
    if (rethrow)
    throw;
    BL Layer
    catch (Exception ex)
    bool rethrow = ExceptionPolicy.HandleException(ex, "Ui Policy");
    if (rethrow)
    throw;
    UI Layer
    catch (Exception ex)
    bool rethrow = ExceptionPolicy.HandleException(ex, "Ui Policy");
    if (rethrow)
    Response.Redirect("ErrorPage.aspx", false);
    We have a tool to check the standards. And tool output is as follows :
    The exception Exception should never been thrown. Always Subclass Exception and throw the subclassed Classes.
    I need suggestions on how to implement the same according to standards.

    Your tool is wrong if it says to never throw Exception.  This was a common recommendation back in the .NET v1 days but has long since been thrown out.  It is perfectly fine to use Exception when you have a general exception that provides no information
    that an application can use to make an informed opinion.
    The general rules of exception throwing is to throw the most specific exception that makes sense. If there is no specific exception that applies and it would be useful for the caller to handle the exception differently than other exceptions then creating
    a custom exception type is warranted.  Otherwise throwing Exception is reasonable. As an example you might have an application that pulls back product data given an ID. There is no built in exception that says the ID is invalid. However an invalid ID
    is something that an application may want to handle differently than, say, an exception about the product being discontinued.  Therefore it might make sense to create an ItemNotFoundException exception that the application can react to.
    Conversely there is no benefit in having different exception types for disk full and disk quota met. The application will respond the same in either case.
    Michael Taylor
    http://blogs.msmvps.com/p3net

Maybe you are looking for

  • Is it possible to delete the table of contents in a pdf but keep the bookmarks?

    Is it possible to delete the table of contents in a pdf but keep the bookmarks?

  • MM Period close in case of short period

    Hi , We have maintained year dependent fiscal year and maintained periods for 2014 in which period 5 is of 20 days. Now when we are closing period 5 and opening period 6 which means from 21st period 6 should work, system is not allowing to open perio

  • Lead Time calculation in process order

    Hi,       I have a process order to be created of 112.6 L. i have only one phase  & one resource allocated. i have maintained my OH time as 1 H in my master recipe. now for resource i have maintained scheduling formula as ZRUNA = OH. After creating P

  • Drag and drop problems in 10.7.2

    Hello! I´ve a MacBook pro 13" with stock 10.7.2, when I drag and drop several files, the shadow of the files freeze on the screen, and there´s no way to remove them other than force quit the Finder. It´s quite annoying. Any idea on this? Best Regards

  • I have a 10.6.8 version, how do I upgrade to 10.7?

    I have a 10.6.8 version on my mac book pro, how do I upgrade to 10.7? plus I have no Icloud on the System Preferences, my Icloud works with itunes only... not with Iphoto ... why?