Is including an error handler in every procedure OK?

Hello,
I have read a lot of articles about error handling on the internet but could not find advice on whether it is good/acceptable practice to put a handler in every procedure. My goal
when debugging is to break on every error, so that the relevant variables are still in scope, and I can view them and react to the error. Is there a VS setting for this, or do I need to achieve this via error handling?
In VB6 I think that there used to be a “Break on all errors” option.
Currently, many procedures in my code do not have error handlers. When an error is encountered in a procedure that does not have an error handler, I believe that control is passed back down the stack to the first procedure that has a Catch.
This makes it hard to debug, because the error variables that I need to review are out of scope.
Therefore, if one is not worried about performance considerations, is it reasonable/best practice to include an error handler in every procedure where there might conceivably be an error?
Also, how will the above approaches affect runtime behaviour?
Many thanks.
Keith
R K Howard

Hi Keith,
First, just to be clear, I am going to assume that by error handling we are talking about Try-Catch blocks in code.  As Acamar said, if you write a block of code that has the potential to fail, and you have a plan for doing something when that failure
occurs, then definitely wrap the code block in a Try-Catch. 
As for what happens in the debugger when an error occurs, it depends on the context of the error and the assembly in which it occurred.  If you are still on the UI thread and the error occurred in your code or a base class library, then execution
will stop on the line of code that caused the error - with or without a Try-Catch.  If however the error occurred in another thread, asynchronously, or within an assembly for which you do not have source code (or in unmanaged code), then the debugger
will break at the lowest spot in the stack where managed code with known source was executed, or nowhere (no source available) if there is no source code or you broke in unmanaged code.  In these cases, adding a Try-Catch might let you break closer to
the exception because there is managed code executed to create the Try statement - but it still doesn't let you break
at the actual exception because there's still either no source code or the error is unmanaged.
So I guess the answer is two-part: don't be afraid to use Try-Catch anywhere that it makes sense, and wait for the improved debugging experience in the next version of Visual Studio (they're improving the ability to debug with secondary threads and async
code execution).
Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

Similar Messages

  • Error Handling in Stored Procedure code

    Hi All,
    I need to know which step is failing and whats the error message when i run a stored procedure.
    Lets say i have a stored procedure with below content.So i want to know which of the below four statements failed,and
    the error message belonging to it.
    How can i modify the below code to achieve my output.
    begin try
    DELETE FROM Table1 WHERE Column1 = 'A'
    UPDATE Table1 SET Column1 = 'C' WHERE Column2 = 'B'
    SELECT * FROM Table1 WHERE Column3 = 'C'
    SELECT * FROM Table1 WHERE Column4 = 'D'
    end try
    begin catch
    end catch
    Thanks in Advance!!

    Take a look at this excellent TechNet Wiki article
    Structured
    Error Handling Mechanism in SQL Server 2012
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • User defined error handling in PLSQL procedure of portal form

    I need some help of building a user defined exception handling in PLSQL.
    I build a portal form based on a PLSQL procedure.
    In this procedure there are several SQL statements with exception handling.
    In case of exception I want to display my on error message and than raise the procedure, so that the user can read the message and than go back to form.
    I try this by calling a raise statement generating some HTML output over htp.p() but than the output look's like
    SQL:
    begin
    "ACHEMA2003"."P_LOGIN" ( P_STAMM_SEQ => 33491, P_ADRESSNR => 2009721, P_PASSWORD => '3333', P_PROJEKT_ID => 'ACHEMA2003', P_MESSENR => '00023', P_SPKZ => 'D');
    end;
    ORA-20000:
    Login ACHEMA 2003
    Ung|ltiges Passwort !!!
    Back to form
    I want to supress the standard Oracle messages.
    Now I read about the packages wwerr_api_error and wwerr_api_error_ui to make this, but it seems to be a little difficult.
    Is there anybody who have a solution for this problem, perhaps some example PLSQL code for this.
    Thanks Erwin.

    Jacob,
    Try following:
    declare
    v_sender VARCHAR2(1000);
    v_sender_id NUMBER;
    begin
    v_sender := p_session.get_value_as_VARCHAR2(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_SENDER');
    v_sender_id := p_session.get_value_as_NUMBER(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_SENDER_ID');
    insert into hd (number, text) values (hd_seq.nextval,
    'step 3 v_sender = ' || v_sender ||
    ' v_sender_id = ' || v_sender_id);
    if v_sender_id >= 100 then
    p_session.set_value(
    p_block_name => "_block",
    p_attribute_name => '_STATUS',
    p_value => 'Sender ID must be less than 100!');
    -- return to your form with status message set
    -- and all fields filled with recent values
    return;
    end if;
    end;
    -- This point is reached only if validation is OK
    doInsert;
    Regards,
    Henn

  • Error Handling Routine

    Hi Experts,
    Can anyone provide me the error handling routine (package/procedure)? or any link?
    At present I am just using the Raise_Application_Error and then handling it in When Others exception clause. But now I need some kind of mechanism which captures all my errors and then send the errors to front end (HTML/Jscript).
    Your help would be appreciated.
    Thanks,
    Ba
    London

    Remove the WHEN OTHERS clause. The exception will be propagated back to your front-end, as God* intended.
    *Larry.                                                                                                                                                                                                                                       

  • How can I add error handling facilities to this code?

    Hi everyone, i have this code that needs some error handling facilities (messages that warn user the data inputted is not valid that prvent crashing) added to it. I have no idea on how to do it and i accept any ideas. I'll post the code in two sections as it doesnt fit. The code works by recieveing inputs for student grades and calculating the total and the average. That works fine, but i need to include an error handling facility that doesnt allow the user to input letters, special characters or numbers outside the range 1-10. Can anyone help?

    Code Part 1:
    import java.text.DecimalFormat;
    import javax.swing.JOptionPane;
    import javax.swing.*;
    import java.util.*;
    //Defines the counter for the student count and uses a usage method to
    public class EdronProject {
      private              int           studentCount;
      private static final String        USAGE = "Usage: java EdronProject <student count>";
      private              List<Student> list;
    //Set up the counter fo the number of students and the list in which
    //each student's information is saved once processed
      public EdronProject(int count) {
        studentCount = count;
        list = new ArrayList<Student>();
    //Checks the number or arguments, and it executes the rest of the code
    //if there is 1 argument or more (the number of arguments = the number
    //of students being processed)
      public static void main( String args[] )  throws NumberFormatException {
       int count = 0;
       switch (args.length) {
         case 1: count = Integer.parseInt(args[0]); break;
         default: System.out.println(USAGE); System.exit(0);
      //Defines method for processing and printing students within the
      //EdronProject class 
        EdronProject edp = new EdronProject(count);
        edp.processStudents();
        edp.printStudents();
      class Student {
      //Define integer values for the 5 subject's grades, the gradeCounter (used
      //in the processing stage) and the student name string
          private int 
                    gradeCounter,
                    grade1,
                    grade2,
                    grade3,
                    grade4,
                    grade5;
         private double total;
         private String studentName;
    //Use setter getter methods for the student name to be retrieved
        public void setStudentName(String name) {
           studentName = name;
        public String getStudentName() {
          return( studentName );
    //Use setter getter methods for the grades inputted to be retrieved
    //by the processing stage
        public void setGrade(int gradeNo, int grade)  throws IllegalArgumentException {
          switch( gradeNo) {
            case 1 : grade1 = grade; break;
            case 2 : grade2 = grade; break;
            case 3 : grade3 = grade; break;
            case 4 : grade4 = grade; break;
            case 5 : grade5 = grade; break;
            default: throw new IllegalArgumentException("ERROR: Bad grade number passed!");
      //Increase grade counter for it to register the number of grades inputted
      //by user
          gradeCounter++;
        public int getGrade(int gradeNo)  throws IllegalArgumentException {
          int grade = 0;
          switch( gradeNo) {
            case 1 : grade = grade1; break;
            case 2 : grade = grade2; break;
            case 3 : grade = grade3; break;
            case 4 : grade = grade4; break;
            case 5 : grade = grade5; break;
            default: throw new IllegalArgumentException("ERROR: Bad grade number passed!");
    //Return grade values for them to be used by the processing stage   
          return( grade );
        }

  • Error Handling on procedure based forms

    Hi all,
    I have seen examples of error handling on table based forms like
    the following:
    begin
    doInsert;
    exception
    when others then
    --redirect to some error page
    I have tried the same with a procedure based form by wrapping
    the doSubmit procedure, but when the procedure returns an
    exception, it doesn't execute my exception handling code.
    Any ideas on why this is happening or at least how I can catch
    these exceptions with my own exception handler?
    Thanks,
    Curt

    Chetan, Antonio,
    I opened a TAR on this issue with Oravle and they got the same
    results. Thay suggested a work around of creating an error table
    that gets written to and then dispaly and new page to retrieve
    the error from the table.
    What I ended up doing is creating a dummy procedure that does
    nothing (NULL). The form based on the dummy procedure allows me
    to get the values I need from the user.
    The procedure always returns succesful since it doesn't do
    anything. So in the form success code area I call the real
    procedure, check the return value, and now I can redirect back
    to the orignal form on error, or direct to another paqe on
    success.
    Not the most elegant solution, but it is working for now.
    Curt

  • Oracle stored procedure call failed,but not captured by the error handling

    Hi All,
    I have a unix shelll script which calls a stored proc in Oracle, the stored proc call failed due to "ORA-01033: ORACLE initialization or shutdown in progress".
    But it is not captured in the error handling block, Any ideas why this had happened?
    SQL file had : my_test_sql.sql
    exec my_proc(..............);
    Unix shell script has this call:
    sqlplus -s my_user/my_pwd@db1 @my_test_sql.sql
    if [[ $? -ne 0 ]]; then
    echo "failed"
    exit 1
    else
    echo "success"
    fi
    If i execute the above shell, I'm getting the following
    ERROR:
    ORA-01033: ORACLE initialization or shutdown in progress
    SP2-0306: Invalid option.
    Usage: CONNÝECT¨ Ýlogon¨ ÝAS SYSDBA¨
    where <logon> ::= <username>Ý/<password>¨Ý@<connect_identifier>¨ | /
    success.
    This puzzled me, any pointers?

    The $? status variable shows the return code of the last command executed. It will be difficult to determine what the exit status of your sql script is without knowing the script. Do you have any "WHENEVER SQLERROR EXIT" statements in the script?
    The ORA-01033 error happens when the database is not open, perhaps in recovery, or startup or shutdown is halted due to a failed or full disk, error in archiving or writing to redo, etc.

  • How to take control back from service error handler in osb

    I am using osb to send data to multiple services at the same time.since x query is a procedural language if any single operation fails the flow goes to service error handler which calls a BPEL webservice and logs the error in a database but the control doesnt comes back to my code I have tried everything including RESUME,REPLY operations but all in vain similarly i cannot use service callout call to my business service because its not allowing to select my BPEL wsdl operation

    If your statement "the control doesnt comes back to my code" means you expect that your xquery will continue in processing than your expectations are just too high. :-)
    Resume action is supposed to resume the next action in the message flow. It means the action that follows the action which caused an error.

  • Error-handling in PKGBUILDs is far from perfect

    Hi, PKGBUILDs should die on failure, rather than just continue regardless of errors. Here's a little rant:
    Why is it acceptable for ./configure to fail? Or make install to fail? Or the installation of just about any file? They could fail for lots of reasons, such as expecting a non-existent directory to exist, just being badly-written, or disk corruption, or running out of disk space. I see this lack of error-handling both in official packages and in the AUR.
    Failing on an error is a fundamental part of programming, and BASH makes a mockery of it. And then Linux developers seem to get brainwashed by BASH into believing that mixing important and non-important errors together, then just ignoring all the errors, is an acceptable programming practice. It's not - it's a comedy of errors (excuse the pun).
    SourceMage handles this problem by having one huge command constructed with && at the end of each line, so at least will fail on error.
    Gentoo is using its custom die command more often these days (|| die), but my proposal is in limbo, presumably because "SpanKY" overrules every other dev (little bit of Gentoo politics there ).
    The current practice of make || return 1 is correct, but || return 1 should be used far more often - example  (notice the looped use of install, and the annoyance of having to check $? after the loop). "More often" includes make install even if it's on the final line, both for consistency, and so it is not forgotten to be added when further lines are added to the end (e.g. to install the license/documentation files).
    I'll place this on flyspray after a bit of feedback.
    Edit: I'll distro-hop instead.
    Last edited by brebs (2008-04-21 13:55:33)

    I'm as guilty as anyone in this.  However, I always use it on the initial "configure" and "make install" lines where there is a lot of output.  I tend to miss it when installing individual files at the end (e.g. Licences, icons...) because I can see if they failed from the output.

  • Error Handling in Forms

    Dear all,
    we are using oracle developer suite 10g r2 with oracle database 10g r2 against windows server 2003.
    Error handling is a very big issue.
    i try to do the following, just correct me, or make the trigger more efficient.
    i face unexpected messages, like a message two time displayed, sometime important message never displayed.
    i just set the :system.message_level =20 in the when-new-form-instance trigger.
    and create on-error trigger like below
    declare
    errcode number:=error_code;dbmserrcode number;dbmserrtext varchar2(200);
    formtxt varchar2(200);
    errtype varchar2(3);
    begin
    --------- user defined database exceptions errors raised by --RAISE_APPLICATION_ERROR
    IF DBMS_ERROR_CODE in (-20738,.......) then
    raise form_trigger_failure;
    end if;
    if error_code=50017 then
    message('duration must be between 0 and 23');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    elsif
    error_code=40202 then
    clear_message;
    message('please provide the required fields.');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    elsif error_code=50022 then
    clear_message;
    message('time must be in the correct format.');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    end if;
    if error_code in (40509,40508) then
    dbmserrcode:=dbms_error_code; dbmserrtext:=dbms_error_text;
    if dbmserrcode=-1438 then
    clear_message;
    message('your number is too large.try again.');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    elsif dbmserrcode=-1400 then
    clear_message;
    message('your forgot to provide a value.try again.');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    elsif dbmserrcode=-2291 then
    clear_message;
    message('header is not found for this insertion.');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    elsif dbmserrcode=-1 then
    clear_message;
    message('record already exists');message(' ',no_acknowledge);
    raise form_trigger_fialure;
    else
    clear_message;
    message(error_code||' : '||error_text);message(' ',no_acknowledge);
    raise form_trigger_fialure;
    end if;
    else
    clear_message;
    message(error_code||' : '||error_text);message(' ',no_acknowledge);
    raise form_trigger_fialure;
    end if;
    exception
    when others then
    if dbms_error_code=-20738 then
    clear_message;
    message('Error: absent or later record errror from the database trigger.);
    raise form_trigger_failure;
    elsif .....
    esle
    clear_message;
    message(error_code||' : '||error_text);message(' ',no_acknowledge);
    raise form_trigger_fialure;
    end if;
    end;any suggession?
    Regards

    i must come with a plsql code which handle every error and suppress unnecessary messages.Good luck with that. No matter how well thought out or planned, you're not going to be able to take all scenarios into account. The design of an exception handler takes time to address all possible scenarios you want handled and even then, you're not likely to handle every situation in the beginning.
    could we implement the oracle ebusiness error handling procedures here in our application?if yes, then where could we find that procedure?>
    I've dug through that code and it is not a thorough as you think it is. It handles specific situations and then defaults the rest. It is a good model for your own exception handler, however. That is what I used it for. :) I don't recall which library it is in, but I'll look around and if I find it, I'll post it.
    I agree with Andreas's comment...
    Simply remove your ON-ERROR-trigger, then you have a default. That's nothing better or worse than what apex has.I'm not too familiar with Apex; I've worked with it, but it's been a little while. Even with Apex, you're going to have to develop a customized Exception Handler so more intuitive or application specific messages are displayed in response to an exception.
    As to Andreas's comment...
    For your own error-handling... The "simplest" way in my eyes is create your own error-table where you have appropiate columns for the error-code and the error-type (FRM,ORA,Whatever), then in your ON-ERROR-trigger read the appropiate record from that table and show the error. You could also have a flag in your table which decides what to do with a specific error (Show as Message, Show as Alert, Don't show at all) and react accordingly.This is exactly what we implemented in our application. We created a set of tables that contain all of the Oracle Runtime errors and their attributes (Error Type, Severity Level, etc). Then we wrote a standard On-Error trigger that is subclassed to all of our forms that calls a Library "On_Error" package. This package evaluates the exception raised, compares it to the database entry for the error and then displays an appropriate message depending on the Severity Level, Error Type (ORA or FRM) and Message Type (Informational, Error, Caution) and we display the message in either the Status Bar, Note Alert, Caution Alert or Stop Alert or it is supressed. If an error is not found in the table, then it is displayed in a Stop Alert as an "Unhandled Exception." The second table I mentioned contains all of the messages used by our application and is cross referenced with the table that contains the Oracle messages. By simply assigned one of our messages to an Oracle message - our package will display our message instead of the default Oracle Message. Yes, this took sometime to build and test and once implemented, we spent another couple of months perfecting it, but now it is pretty solid and we haven't had to modify it in over a year.
    While this level of complexity may be overkill for your application, it does offer the greatest flexibility in the long-run. Also, if your application must support multiple languages, having all of your messages in a table make internationalization extremely easy. :)
    The point of all this, is that no matter which system you use (Forms, Apex, or Java) you will still need to invest some time into designing an Excpeiton Handling method for your application and then implement it accross the application. This is not something you can develop in a short period of time and it will not be perfect in the beginning. However, in the long-run, you will be happy you spent the time up-front to build a flexible and robust Exception Handling system.
    Craig...

  • Bursting with JAVA APIs / MultiThreading / Errors Handling

    We are trying to use the bursting JAVA APIs 10.1.3.3.1 Standalone) to burst huge XML files and generate PDF Files from RTF templates. Here are a list of our issues with this feature:
    1. We have some problems catching the errors when bursting. We have tried to use the "oracle.apps.xdo.common.log.Logger" class, but it is not always reacting like we think it should. Could you please give us an exemple of a clean bursting error catching or a brief description of how we could do it. We have a lot of difficulties to find information about using the JAVA APIs of BIP.
    2. Is it a clean way of catching the bursting errors to use the "oracle.apps.xdo.common.log.Logger" class?
    3. When using the 10.1.3.3.1 DocumentProcessor JAVA API, the process gets killed when the RTF template is not where the control file specified it. Even when using a finally clause containing the document processor, we can't fetch the error from the "oracle.apps.xdo.common.log.Logger" class. We did not find a way to catch this error which make our program crash.
    4. How can we enable multi-threading that is included in the DocumentProcessor JAVA APIs so it can take advantage of the multi-processors environnements?

    1. Check tim d. blog, you can use the bursting listners to get the errors. It's also in the documentation.
    First, on every exception, the Bursting APIs are dumping the error in the Logger. So I can't see how we can use the listeners to catch these. We can check the hasExceptions on the Logger but still, we have some problems with this. When we deploy our application as a MDB (Message driven bean), it seems that once the hasException flag has been raised, if we call the MDB again, it is still up. Is there documentation about that Logger class? Also, I'm worried that we won't be able to call our MDB twice to run simultaneously 2 different bursting process since it seems the Logger is something static, keeping every exception in memory... That's bad.. And show me where you have found documentation about this. All I see in documentation is how to call the DocumentProcessor in a couple of lines. I don't see anything about a clean way to catch errors.
    2. Yes/No/Depends. I think it's fine. If your changing the logger options in your program that could come back to haunt you.
    I guess so, I'm not changing anything and its already haunting me...
    3. When using the 10.1.3.3.1 DocumentProcessor JAVA API, the process gets killed when the RTF template is not where the control file specified it. Even when using a finally clause containing the document processor, we can't fetch the error from the "oracle.apps.xdo.common.log.Logger" class. We did not find a way to catch this error which make our program crash.
    Even worst, when we deploy the component has an MDB, when the error happens, it kills the whole oc4j container... please correct this quick.
    4. How can we enable multi-threading that is included in the DocumentProcessor JAVA APIs so it can take advantage of the multi-processors environnements?
    We got an answer from the dev team which is to add two properties to the document processor, something like:
    enable-multithreading: true
    thread-count: >2
    We did that and what we got is that the process started and it got stuck in a dead lock at the first document processing. How nice! :)
    We got a milestone in March and I'm really worried about all those problems... Not enough documentation, a pretty bad error handling, errors making crash the whole oc4j container, Logger seems not to be handling simultaneous calls/ threads, not even handling two subsequent calls... etc.
    If anyone has the magic answer, it would be pretty welcomed!
    Thanks

  • Query related to error handling

    hi All,
    In my proxy flow i have stage level error handler which is configured to an alert pointing to an JMS error queue. When i added service level error handler with same alert.
    I am getting duplication of the same error message by stage and service error handler.
    For every error i am receiving 2 error messages at the error queue.
    Is there any option in ALSB which allows me stop the duplication.

    Pls check the following script --
    SQL>
    SQL> create or replace package uu_test
      2  is
      3  begin
      4    test
      5  end;
      6  /
    Warning: Package created with compilation errors.
    SQL>
    SQL> select * from user_errors
      2  where type = 'PACKAGE';
    NAME                           TYPE           SEQUENCE       LINE   POSITION
    TEXT
    UU_TEST                        PACKAGE               1          3          1
    PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following:
       end function package pragma private procedure subtype type
       use <an identifier> <a double-quoted delimited-identifier>
       form current cursorHope this will fullfill your requirement.
    Regards.
    Satyaki De.

  • Xml forms - Error handling HTTP request

    Hello,
    We have installed portal 6.0
    I've made some forms with the xml form builder, imported them into IViews (KM navigation IView) and assigned the IViews to a role
    The Iview shows the RenderListItem form
    Every Iview (RenderListItem form) has a "new item" button
    Every record of the iview has a edit-delete action
    When I press the "new item" button or the edit button (or save button) I get the following error:
    Error handling HTTP request. Check the log file for more information.
    java.lang.RuntimeException: Context is unavailable!
         at com.sap.pct.plm.dmsrmconnectorforkm.DMSRMConnection.(DMSRMConnection.java:83)
         at com.sap.pct.plm.dmsrmconnectorforkm.DMSRMR3FunctionCalls.getGenericValueList(DMSRMR3FunctionCalls.java:6532)
         at com.sap.pct.plm.dmsrmconnectorforkm.DMSRMR3FunctionCalls.getLaboratoryList(DMSRMR3FunctionCalls.java:6360)
         at com.sap.pct.plm.dmsrmconnectorforkm.DMSRMLaboratoryValueProvider.getAllowedValues(DMSRMLaboratoryValueProvider.java:79)
         at com.sapportals.wcm.service.propertyconfig.config.MetaName.getAllowedValues(MetaName.java:781)
         at com.sapportals.wcm.service.propertyconfig.config.MetaName.allowedValueIterator(MetaName.java:472)
         at com.sapportals.wcm.service.xmlforms.ResourceProperties.appendAllowedValues(ResourceProperties.java:713)
         at com.sapportals.wcm.service.xmlforms.ResourceProperties.mergeProperty(ResourceProperties.java:682)
         at com.sapportals.wcm.service.xmlforms.ResourceProperties.mergePropertiesIntoDom(ResourceProperties.java:611)
         at com.sapportals.wcm.service.xmlforms.transformation.HtmlGenerator.getHtmlStream(HtmlGenerator.java:116)
         at com.sapportals.wcm.service.xmlforms.transformation.Transformation.render(Transformation.java:391)
         at com.sapportals.wcm.service.xmlforms.transformation.Transformation.render(Transformation.java:336)
         at com.sapportals.wcm.service.xmlforms.transformation.Transformation.render(Transformation.java:188)
         at com.sapportals.wcm.app.xmlforms.EditServlet.doGetAction(EditServlet.java:165)
         at com.sapportals.wcm.app.xmlforms.XFBaseServlet.doGet(XFBaseServlet.java:241)
         at com.sapportals.wcm.app.xmlforms.XFBaseServlet.doPost(XFBaseServlet.java:261)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sapportals.wcm.app.xmlforms.XFBaseServlet.service(XFBaseServlet.java:134)
         at com.sapportals.wcm.portal.proxy.PCProxyServlet.service(PCProxyServlet.java:331)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sapportals.portal.prt.core.broker.ServletComponentItem$ServletWrapperComponent.doContent(ServletComponentItem.java:110)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
         at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
         at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:646)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
         at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
         at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
         at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:545)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    This error doesn't always appear, there are times that the portal works correct and when I can add items, edit them and save my changes
    Does anyone have an idea where the error comes from? In what direction I have to search? How I can solve this problem?
    Thanks in advance, points will be distributed for helpfull answers

    Hi,
    I didn't place a save button on the RenderListItem but on the Edit form so this couldn't be the issue...
    I solved the error I got when I wanted to save my form
    The edit and delete buttons also work correct...
    I only get the error mentioned above when I press the "new form" button, I created that button with the CreateXMLForms action group that I added in my Collection Grid renderer settings (option collection command group)
    Then I changed my form availibility (System administration ->system configuration ->KM->CM->form based publishing->form availibility->folder settings)
    I created the following folder settings:
    foldername//priority//path//forms to exclude//forms to include
    library//10 //documents/testlibrary//Smarties, QnA,SAP_APP_News//library
    News //10 //documents/News//smarties, library, QnA// SAP_APP_News
    QnA //10 //documents/testQuestionAnswer// SAP_APP_News, smarties, library //QnA
    Smarties //10 /documents/testSmarties
    Did I do something wrong here? What can cause this error? In what direction should I search?

  • Initial error in call to procedure is cached

    Hi,
    I'm running Apex 4.1.0.00.32, with Apex Listener 1.1.3.243.11.40 in WebLogic 10.3.3.0.
    I've noticed that if I run a procedure (/apex/schema.procedure) and the first call is unsuccessful (because of an error in the procedure or lack of privilege), all later calls will also fail.
    Example, create this procedure:
    create or replace procedure bug as
    begin
    htp.p('Hello bug');
    end;
    Try to run it using the url http://<server>/apex/<schema>.bug
    The web page will show just "Not Found". The listener error log will show
    HTTP Status Code: 404 Requested url http://<server>/apex/<schema>.bug is not found.
    The problem now is lack of grant. So, do a "grant execute on bug to apex_public_user;".
    Refresh the web page but "Not Found" persists.
    There are now two options:
    - change the url to (for instance) http://<server>/apex/<schema>.Bug (ie change case)
    - restart the whole weblogic server (stopping the Apex deployment is not possible)
    As changing the case of the url is not practical if the application is generating links, a restart is the option left.
    Is this "caching" of initial failure the expected behaviour or have I missed some configuration?
    I have no caching enabled in the listener.
    Kind regards
    Tomas Albinsson
    Stockholm, Sweden

    why would the listener look up metadata for the procedure to call?
    Either the user has the correct procedure name and parameter names - the call succeeds.
    Or the name or some parameter is wrong - the call fails and is reported to the user.Hi Tomas,
    Let me just repeat again that I don't know exactly how the Apex Listener implements its database calls.
    My comments are based on my own experiences from writing the Thoth Gateway, which essentially does the same thing as mod_plsql and the Apex Listener, except it is written in .NET and runs on Microsoft IIS. See http://code.google.com/p/thoth-gateway/ for more details.
    One reason for caching the procedure metadata is this:
    Let's say you have a procedure with a parameter which is a "table of varchar2" (such as the f01, f02, etc. parameters in the "wwv_flow.accept" procedure in Apex). These can accept zero, one or more values, depending on how many times you have repeated that input element name on the HTML page.
    So the Listener receives a call for the "wwv_flow.accept" procedure with a single value for the "f01" parameter. Without looking in the data dictionary (see DBA_ARGUMENTS), there is no way the Listener can know that the f01 parameter is actually a "table of varchar2" (and needs to be bound as that datatype when invoking the stored procedure). If the value is bound as a string (plain varchar2) parameter, the procedure call fails.
    Now, there are at least two ways to handle this: You can either catch the error, assume it was really a "table of varchar2" parameter, and try again with that; or you can look it up in the data dictionary beforehand to avoid the error. In either case, it's not good for performance to do this for every procedure call.
    The Thoth Gateway actually works this way: It first checks whether it has cached metadata for the procedure. If not, it tries to call the procedure based on just the names and values. If this fails, it silently catches the error and then looks up the procedure metadata from the data dictionary to make sure the parameter types are correct. It then calls the procedure again (and hopefully that should be successful). Then the metadata is cached. Which means that any subsequent invocations of the same procedure don't need to go through the same work again.
    Looking up (and caching) the metadata also has another benefit: If there are input elements on the HTML page that do not correspond to parameter names in the procedure (perhaps some client-side JS framework added some input fields dynamically), then the procedure call would fail. You can see this in action using mod_plsql and DBMS_EPG (you get an error along the lines of "arguments in form not in procedure..."). However, the Thoth Gateway (and I believe also the Apex Listener) checks the incoming parameter names against the metadata, and just discards any parameter names/values that are not in the procedure.
    - Morten
    http://ora-00001.blogspot.com
    Edited by: mobra on Oct 20, 2011 10:52 AM

  • Additional error handling within a production application using SQLERRM

    I have an application that is already in production. What I would like to do is to add additional error detail currently captured within the SQLERRM. I would like to capture detail such as: where the error occurred ie. what procedure in which package attempting to insert in which table etc. etc. Is this something that I can do easily without writing hundreds of exceptions into the existing code? Please respond if you know of a way to do this.
    Thanks in advance

    Probably not, unfortunately. To get that level of detail, you would need to go in to every procedure and add appropriate exception handlers, state variables (so you know what table you were inserting into). Adding error handling into any application after it is "done" is going to require some heavy lifting.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

Maybe you are looking for