Error handling problem

Is there a way to "catch" an integrity constraint in PL/SQL. the integrity constraint that i want to catch is a violation to the foreign key.
the error number is ORA-OO291
Regard,
Richard

SQL> declare
  2   e exception;
  3   pragma exception_init(e,-2291);
  4  begin
  5   insert into t2 values(1);
  6  exception
  7   when e then
  8    dbms_output.put_line('Error..');
  9  end;
10  /
Error..
PL/SQL procedure successfully completed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • ColdFusion.Ajax.submitForm error handler problem with AppleWebKit-based browsers

    All-
    When using an AppleWebKit-based browser (i.e. Safari or
    Chrome), the
    message argument of the Coldfusion.Ajax.submitForm error
    handler always contains the string "OK", regardless of what error
    was cfthrown by my CFM form handler.
    Recall that the signature for the error handler is this:
    MyFormErrorHandler = function( code, message )
    In other browsers (i.e. IE or Firefox), the
    message argument of the error handler properly contains the
    message that was cfthrown by my form handler.
    Can anyone offer any guidance for this problem? Thanks in
    advance for your help.
    -Josh

    I was testing on IE8, Windows7 Starter.  I don't have IE6 available to test on.  Can test on IE7 a bit later on, but I have to fart-arse around with a VM to get it ready, so I'll do that after work.
    I tested multiple submits both via clicking between the tabs within one main "request" as well as multiple entire requests (like via refreshing the whole browser window).  I had no problems.
    I think you're being quite optimistic ot expect AJAX stuff to work reliably on IE6.  IE6 crashes.  That's what it's most famous for doing.  One needs to expect crashes if one pushes it (push it anywhere than out the window, that is).  And your client company's IT dept should be lined up against a wall and shot for still running it.  That's professionally negligent IMO.  But... you probably don't need to be told that.
    Adam

  • Error handling problem with outbound idoc status 02 and  XML HTTP Port

    I set up an ALE scenario to send master data out of SAP via an XML HTTP port.  All goes well until the idoc receives error 02. 
    It looks like idocs in this error status with the use of an XML HTTP port can not be reprocessed via the standard SAP techniques.  Program RBDAGAIN takes them out of the list for reprocessing (even though the connection is back up and running).
    Is there any solution to still use the standard ALE error handling ?

    Hi Karin,
    Looks like based on note 701597, you can only reprocess these idocs manually via a workitem.  I qouted the relevant text below:
    3. Error handling with status '02':
    An HTTP IDoc in status '02' should not automatically be sent once again.
    Up to now, the RBDAGAIN report was used to resend incorrect IDocs.
    However, this report was adjusted and now deletes all IDocs in status 02
    to be routed to a HTTP port from the list of selected IDocs. IDocs to a
    HTTP port in status '02' should only be sent manually via a work item.
    Regards:
    Rex

  • Custom Trigger and error handling problem

    hi ! I'm creating a custom trigger in ASP
    <br />
    <br />all it do is to check the lenght of given string.
    <br />it has a logic , true or false operation.
    <br />I just want to display an error message !
    <br />
    <br />I try BEFORE or AFTER in trigger register, but still didn't work !
    <br />
    <br />but why it didn't work ?
    <br />
    <br />any ideas ?
    <br />
    <br /><%<br />'start Trigger_Custom trigger<br />Function Trigger_Custom (ByRef tNG)<br /><br /> xemployer = len(trim(tNG.getColumnValue("employer")))<br /> xemail = len(trim(tNG.getColumnValue("email")))<br /> xjob_position = len(trim(tNG.getColumnValue("job_position")))<br /> xeducation = len(trim(tNG.getColumnValue("education")))<br /> xreference = len(trim(tNG.getColumnValue("reference")))<br /> xage_max = len(trim(tNG.getColumnValue("age_max")))<br /> xgender = len(trim(tNG.getColumnValue("gender")))<br /> <br /> totallen = (xemployer + xemail + xjob_position + xeducation + xreference + xage_max + xgender)<br /><br /> if (totallen > 158) then<br /><br /> Set update_error = new tNG_error<br /> update_error.init "Your Data contain too much characters ! (max 158)", Array(), Array()<br /> Set Trigger_Custom = update_error<br /><br />  else<br /> Set Trigger_Custom = nothing<br />  end if<br /><br />Set Trigger_Custom = nothing<br />End Function<br />'end Trigger_Custom trigger<br />%>
    <br /><%<br />' Register triggers<br />ins_Job.registerTrigger Array("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1")<br />ins_Job.registerTrigger Array("BEFORE", "Trigger_Default_FormValidation", 10, formValidation)<br />ins_Job.registerTrigger Array("END", "Trigger_Default_Redirect", 99, "../includes/nxt/back.asp")<br />ins_Job.registerTrigger Array("BEFORE", "Trigger_Custom", 50)<br />%>
    <br />
    <br /><%<br />' Register triggers<br />upd_Job.registerTrigger Array("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Update1")<br />upd_Job.registerTrigger Array("BEFORE", "Trigger_Default_FormValidation", 10, formValidation)<br />upd_Job.registerTrigger Array("END", "Trigger_Default_Redirect", 99, "../includes/nxt/back.asp")<br />upd_Job.registerTrigger Array("BEFORE", "Trigger_Custom", 50)<br />%>

    hello there, thanks for replying
    <br />i know what you mean, i see that the first time i submitted in to this forum.
    <br />
    <br />actually IT IS SEPARATED !
    <br />i just copy paste my code into this TextBOX, and that's whats happened
    <br />
    <br />ok i copy paste my code again, but this time i use ENTER to seperated those lines.
    <br />
    <br /><% 'start Trigger_Custom trigger <br /><br />Function Trigger_Custom (ByRef tNG) <br /><br />xemployer = len(trim(tNG.getColumnValue("employer"))) <br />xemail = len(trim(tNG.getColumnValue("email"))) <br />xjob_position = len(trim(tNG.getColumnValue("job_position"))) <br />xeducation = len(trim(tNG.getColumnValue("education"))) <br />xreference = len(trim(tNG.getColumnValue("reference"))) <br />xage_max = len(trim(tNG.getColumnValue("age_max"))) <br />xgender = len(trim(tNG.getColumnValue("gender"))) <br /><br />totallen = (xemployer + xemail + xjob_position + xeducation + xreference + xage_max + xgender) <br /><br />if (totallen > 158) then <br /><br />Set update_error = new tNG_error <br />update_error.init "Your Data contain too much characters ! (max 158)", Array(), Array() <br />Set Trigger_Custom = update_error <br /><br />else <br />Set Trigger_Custom = nothing <br />end if <br /><br />Set Trigger_Custom = nothing <br />End Function <br />'end Trigger_Custom trigger <br />%>
    <br />
    <br /><% ' Register triggers <br /><br />ins_Job.registerTrigger Array("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Insert1") ins_Job.registerTrigger Array("BEFORE", "Trigger_Default_FormValidation", 10, formValidation) ins_Job.registerTrigger Array("END", "Trigger_Default_Redirect", 99, "../includes/nxt/back.asp") ins_Job.registerTrigger Array("BEFORE", "Trigger_Custom", 50) <br /><br />%>
    <br />
    <br /><% ' Register triggers <br /><br />upd_Job.registerTrigger Array("STARTER", "Trigger_Default_Starter", 1, "POST", "KT_Update1") upd_Job.registerTrigger Array("BEFORE", "Trigger_Default_FormValidation", 10, formValidation) upd_Job.registerTrigger Array("END", "Trigger_Default_Redirect", 99, "../includes/nxt/back.asp") upd_Job.registerTrigger Array("BEFORE", "Trigger_Custom", 50) <br /><br />%>
    <br />
    <br />there it is My Actual Code looks like.
    <br />
    <br />again, thanks for replying

  • Report and Alert don't executed in the error handler with a JMS proxy service

    Hi,
    I'm working with OSB 11.1.1.4.0 and I'm facing a problem with the error handler of my JMS proxy service.
    My error handler contains two main elements :
    - a Report action
    - an Alert with a JMS destination defined
    When the business service failed the message remain in the queue. It's the expected behavior.
    The problem is :
    - the report is missing
    - the alert is raised but missing in the JMS destination defined in the Alert setting.
    I've noticed if I add a Reply with Failure or Success, Report and Alert are successfully executed.
    Unfortunately the message don't remain in the JMS queue.
    What can I do in order to have my report/alert done and the JMS transaction rollback in order to keep the message in the queue ?
    I've already met this problem in the past with alsb v3 and my solution was to add Service Callout in the error handler in order to externalize these actions.
    This solution is not convenient and I hope another solution is possible.

    Inventorying workgroups can be difficult, especially when it comes to remote access and network security. Because workgroups are not centrally managed, some of the items discussed in this
    wiki article on preparing your workgroup environment may require you to visit each machine individually.
    For non-domain credentials, you do not use the <systemname>\<user> format, you simply enter the user name. Regarding how to enter the credentials, if you have an account that uses the same username and password on all machines and is an administrator
    on all of those machines, then you can enter that in the All computers credentials page of the wizard. You can also do this if they are different user names. However, if some machines have an account with the same user name, such as Administrator,
    but different passwords on each machine, you will need to use the Manually enter computer names discovery method, and then enter the information for each group or each machine.
    As you can tell, workgroup environments can quickly negate any benefit that the agentless inventory nature of MAP provides.
    Please remember to click "Mark as Answer" on the post that helps you, and to click
    "Unmark as Answer" if a marked post does not actually answer your question. Please
    VOTE as HELPFUL if the post helps you. This can be beneficial to other community members reading the thread.

  • LV7.1 Strange behavior with Automatic Error Handling occuring when it shouldn't [LV 7.1 Pro on WinXP for Tablet PC's]

    [LV 7.1 Pro on WinXP for Tablet PC's]
    I recently let a rather large LV app of mine run in the development environment while I was out for a couple of days. Upon returning I found that the app had hung for ~22 hours waiting for an answer to an Automatic Error Handling (AEH) dialog proclaiming an Error 7 in New File without any indication of the VI hierarchy that called New File.  I set about ensuring that AEH dialogs would not pop up and have not been able to discover how I could have possibly received one in the first place.
    Subsequent investigation revealed:
    Neither AEH option in Options>Block Diagrams were checked.
    Network problems had occurred around the time that the app had hung.  All file paths are network paths when running in the development environment, so the cause of the error was most likely valid, even if the AEH dialog appearance wasn't.
    My app has only one instance where the New File primitive is used by me. That subVI and all others above it in the hierarchy DO NOT have the AEH property enabled.  The error out cluster of New File in my subvi is wired.
    My app has three instances where New File is called from a vi.lib vi (Open/Create/Replace File.vi, Open Config Data.vi, and Prompt Web Browser Path.vi), none of which have the AEH property enabled.  Nor does any of their calling VI's.  All three instances also have their error out cluster wired.
    A utility to examine the AEH property of all VI's (with all top level and dynamic VI's loaded) in memory reported that only 1 of 308 vi's ( RGT Does File Exists.vi from the Report Generation Toolkit) had that property true.  That vi has no subVI's other than the File/Directory Info primitive and no calling VI's in common with any of the vi's that call New File, except a top level VI.
    As long as 'Enable automatic error handling dialogs' remains unselected in options>block diagram, I am unable to get an AEH dialog for either the New File or File/Directory Info primitives in a test VI with AEH property enabled and their error out clusters unwired no matter what invalid path I pass to the functions.  As soon as the options>block diagram>Enable AEH dialogs' is selected, both primitives fire AEH dialogs with no error out wired and don't when wired. i.e. works as advertised.
    In other words I can find no reason why I should have gotten the problem AEH dialog...
    I cannot afford for this app to hang because of a network problem, other portions of the app that were running concurrently correctly handled the error and, had the AEH dialog not appeared, the app would have made corrections or shutdown in an orderly fashion.
    Any ideas?

    Very good.
    Write Characters to File.vi>Open/Create/Replace File.vi>New File
    New File throws the error.  Open/Create/Replace strips the hierarchy from the source of the error.  Write Characters passes it to the General Error Handler.  I never looked above O/C/R file in the hierarchy except for enable automatic error handling property.  The tip-off should have been to realize that O/C/R file was stripping the hierarchy from the error and look above that. 
    The real irony is that Write Characters was being used to log error cluster data to an error log file...
    Save as... Copy without updating... the OEM 'Write Characters to File' is gone from this app.
    Thanx (a bunch)

  • Error handling in process chain-doubts

    Hi ,
    I have some doubts in error handling of process chains.
    1) I have  aprocess load infopackeage and subsequent process is update fromPSA.
    process load infopackage got failed  , so i loaded  the IP manually and repeated the next i.e process update from PSA .
    How to correct the process chain from now?
    2) I have  aprocess load infopackeage and subsequent process is Delete request in infocube .process load infopackage got failed  , so i loaded  the IP manually and repeated the next process i.e Delete request in infocube. Chain continued by deleting the right request . How this is possible ?
    Plz  help me  as this is urgent and daily i have to deal with this  issues. If any documents on error handling is greatly appreciated.
    My mail id is [email protected]
    Regards,
    Pavan

    Hi Pavan,
    Hope the following links will give u a clear idea about process chains and clear ur doubts.
    Business Intelligence Old Forum (Read Only Archive)
    http://help.sap.com/saphelp_nw2004s/helpdata/en/8f/c08b3baaa59649e10000000a11402f/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8da0cd90-0201-0010-2d9a-abab69f10045
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/19683495-0501-0010-4381-b31db6ece1e9
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/36693695-0501-0010-698a-a015c6aac9e1
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9936e790-0201-0010-f185-89d0377639db
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3507aa90-0201-0010-6891-d7df8c4722f7
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/263de690-0201-0010-bc9f-b65b3e7ba11c
    /people/siegfried.szameitat/blog/2006/02/26/restarting-processchains
    Errors in monitoring of process chains can be categorized into 4 different sections...
    Master data - Full Update
    Master data - Delta Update
    Transaction data - Full Update
    Transaction data - Delta Update.. in terms of loading of data which can be due to server shut down or system maintenance... errors due to incorrect entries in the OLTP system in which case you'll have to fix the errors in the PSA and manually load the data...
    Otherwise it can have errors on Attribute change run being locked by some other job... Aggregate Roll up failing because of attribute change run being run at the same time... Problem with hierarchies and save hierarchies...
    There can be problems with the data store activation if the ODS object contains any incorrect request sitting inside it... then, you need to delete the incorrect request and reload the data again...
    In case of Transaction Delta failure, you'll have to request for a repeat either manually in the infopackage or using the repeat option if available on right clicking the load event...
    For Master Data Delta failures, you need to do an Re-init by deleteing the previous initalization condition in the "initalization option for source systems" in the menu scheduler or reschedule the enitre chain... because, master data generally do not support repeat of last delta ...
    U can even look into these links:
    /people/siegfried.szameitat/blog/2006/02/26/restarting-processchains
    For common data load errors check this link:
    /people/siegfried.szameitat/blog/2005/07/28/data-load-errors--basic-checks
    ****Assign Points if Helpful****
    Regards,
    Ravikanth.

  • Error handling in File - XI - SOAP scenario without BPM

    Hello!
    We have a File -> XI -> SOAP scenario without BPM. The problem is that if the Web Service sends back an error XI tries to reprocess the same message again and again instead of taking the next one.
    We do not want set the retry interval to NULL because most error cases are temporary connection problems and then also those messages would not automatically be reprocessed any more.
    We also have to use BE instead of EO, otherwise the Web Service will not return a response. But we need the response to be sure that the processing was successful. The message volume in this scenario is quite high and we do not want to use BPM only for the error handling.
    I know that from SP19 some additional adapter modules are available for async - sync scenarios without BPM. I tried to configure it like described in File - RFC - File without a BPM - Possible from SP 19. but it did not solve the problem. Does anybody have any other ideas? Thanks.
    Regards, Tanja

    Hi Tanja,
    >>>The volume is 3000 messages/day on business days and 700 messages/day during weekends but the traffic will increase in the future
    I think, you should check that out. It is assumedly only 2 days work to build a scenario:
    IDoc -> BP
    BP <-> SOAP/HTTP
    BP -> IDoc (Acknowledgement)
    In the process you need a condition branch, where you decide success or not. You need 2 Interface Mappings for filling the ALEAUD.
    Just send 1000 IDocs to the Test-XI and look to performance monitoring at Runtime Workbench, to find out, how many message will be processed in one hour. Assumedly 3000 and more per day should be possible. The advantage would be to reduce number of systems (no file system) and messages (better monitoring) and using the standard (better maintenance).
    >>>So you are suggesting I should use HTTP adapter and then add the SOAP header manually in a mapping?
    Yes, build the SOAP envelop during the mapping. Most easy is to use XSL or, if your mapping is ready, an additionsal XSL. You can put the error into the Acknowledgement to see it in ERP transaction WE02.
    Filling of ALEAUD fields:
    E1ADHDR/MESTYP: original message type
    E1ADHDR/E1STATE/DOCNUM: original IDoc number
    E1ADHDR/E1STATE/STATUS: 68 in case of error, 53 in case of success
    E1ADHDR/E1STATE/STATXT: Short description for R/3 user what has happend
    I ve done such a scenario several times. That works without any problems.
    Regards,
    Udo

  • Error handling for work item

    Dear All,
         When I trigger my workflow from SWUE,the workflow containers must be populated with agent name.But it is populated only with 'US'.Please suggest.
         On the other hand, when I trigger my workflow from ME21N,the workflow goes into error.The error statement is "Exception occurred - Error handling for work item 000000954797".What is the problem?
        Please suggest the solution for which I will be grateful.
    Thanks and regards,
    S.Suresh

    Dear ,
    I use bus2012 as BOR and event as created.
    When I create purchase order from ME21N,bus2012 is not triggering.Instead FREBUS2012 gets triggered which is a subtype of bus2012.
    At SWETYPV,event linkage is activated only for BUS2012 and there is no entry at SWETYPV for FREBUS2012.
    Though I configured the workflow with start events:BUS2012->created,why FREBUS2012 should trigger my workflow which is not seen in SWETYPV?How to override it?Please suggest.
    There is no start conditions for my workflow.Whenever purchase order is created,this workflow should trigger.
    So,the parameters passed between even to workflow are 
    &_EVT_OBJECT&    ->        &BUS2012&
    &_EVT_CREATOR&   ->     & WFINITIATOR&
    Thanks and regards,
    S.Suresh

  • JCo Client Programming and Error Handling

    Hi all,
    I was wondering if anybody could help me out with some advice on error handling when writing code to send messages to SAP via a JCo Client, particularly IDocs.
    I understand from my reading that IDocs are always sent asyncronously to the SAP system from JCo, using JCO.Client.send(). So it is possible (and I have some test code working to do this) to force an exception with say a malformed IDoc, and catch the exception in my code.
    But due to the asyncronous nature of the send functionality for IDoc, I cannot see any way of getting back any "business level" exceptions (e.g. Order Number does not exist, Unknown Material, etc.)
    So my question is, is it possible to receive any of these type of error messages when sending IDocs to an SAP system using JCo? Perhaps by setting up a JCo Server with the correct error/exception listeners to receive these messages - but are they even sent out in the way?
    If not what is the process for handling them?
    It is of course possible to look in the SAP system using txn WE02 and see the problem/error but that does not help me to propagate this back to the sending application or to maintain state alignment between the two apps.
    Any advice much appreciated!!
    Chris

    Hi Anil,
    you should check on those trheads:
    <a href="https://www.sdn.sap.com/irj/sdn/thread?messageID=3104772&#3104772">https://www.sdn.sap.com/irj/sdn/thread?messageID=3104772&#3104772</a>
    <a href="https://www.sdn.sap.com/irj/sdn/thread?messageID=579794&#579794">https://www.sdn.sap.com/irj/sdn/thread?messageID=579794&#579794</a>
    Regards,
    Gianluca Barile

  • 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 overridden methods in AbstractPageBean

    Hi,
    I'm writing a small app in JSF. One of the pages populates a bunch of text fields from an XML file whose name is passed into the app as an initialization parameter. The purpose of the page is to allow editing of the fields.
    It seemed that the prerender() method was the right place to initialize the fields in the form. I have an application-scoped bean trying to open the XML file. I don't want the app to barf on initialization if the file doesn't exist, because the application contains the logic to create the file. So it just sets the appropriate forward target ("file does not exist" page, or maybe XML parse error) and lets the pages that use those bean properties decide when and if they need to display the initialization error page.
    I would like to throw an exception from the prerender() method in my page, and have the error handling specified in web.xml. The problem, of course, is that I can't throw my own exception from prerender().
    So, have I got the wrong place to initialize my form, or do I have to throw a javax.faces.FacesException, or have I got this whole error-handling thing wrong?
    Any advice would be gratefully received.
    Many thanks.
    Regards,
    Mike
    public void prerender(){
            // Get ApplicationBean1 to forward the request if we fail to
            // initialize properly.
            ApplicationBean1 ab1 = getApplicationBean1();
            HttpServletRequest req = (HttpServletRequest) this.getFacesContext().
                    getExternalContext().
                    getRequest();
            HttpServletResponse res = (HttpServletResponse) this.getFacesContext().
                    getExternalContext().
                    getResponse();
            if(!ab1.isInitialized()){
                //The initialization code for ApplicationBean1() sets the
                //target when it detects an error and then forwards the
                //request to that target upon invocation of the forwardRequest
                //method
                ab1.forwardRequest(req,res);
            // These are the input components
            tfClonebase.setValue(ab1.getClonebase());
            tfDhcpdconf.setValue(ab1.getDhcpdconf());
            tfNamedrev.setValue(ab1.getNamedrev());
            tfNamedzone.setValue(ab1.getNamedzone());
            tfPxelinux.setValue(ab1.getPxelinux());
            tfXmldir.setValue(ab1.getXmlDir());
        }

    Well, I'm certainly no expert, but prerender() is called, as you might expect, just before rendering takes place (but only if the page will actually be rendered). This means it won't be called for a page that handled a postback but then navigated to a different page. Good place to handle initializations that happen before rendering.
    So my thinking was that I could initialize stuff before there's anything in the response, making it easier to bail out if something goes bad.
    But I really can't work out the right way to bail out: I can't throw my own exception because the prerender() is overridden from AbstractPageBean. So I suppose I could create a MikesBadInitException e and throw it inside a new javax.faces.FacesException(e). But I'd like to specify an error-page in my web.xml for MikesBadInitException, and don't want to handle all javax.faces.FacesExceptions, if you get my drift.

  • Error Handling in WebUtil CLIENT_OLE2.get_obj_property

    Hello,
    we have a problem with the error handling in WebUtil's CLIENT_OLE2.get_obj_property function. The WebUtil version is 1.0.2 and the problem can be reproduced on the 9iAS, 9iDS and 10gAS as well.
    Problem description:
    The get_obj_property function does not throw a PL/SQL exception when it is given an invalid object as first argument (i.e. an object handle to an application that has intermittently been closed by the user). Instead, the function returns a NULL value and the control flow of our application code continues as if the function had succeeded. So the problem is that the get_obj_property function neither throws an exception nor can the failure be caught by calling WEBUTIL_CORE.IsError as this returns that no error occurred.
    Example:
    PACKAGE BODY word IS
    OBJ_HND CLIENT_OLE2.OBJ_TYPE := NULL;
    mydocs CLIENT_ole2.obj_type;
    -- Start Word97
    PROCEDURE wordopen is                         
    BEGIN
    obj_hnd := null;
    obj_hnd := CLIENT_OLE2.create_obj ('Word.Application');
    CLIENT_OLE2.Set_property(obj_hnd,'Visible',1);
    END;
    PROCEDURE test is
    BEGIN
    IF obj_hnd IS NULL THEN
    wordopen;
    END IF;
    BEGIN
    mydocs := CLIENT_OLE2.get_obj_property(obj_hnd,'Documents');
    EXCEPTION WHEN OTHERS THEN
    -- Word has probably been closed by the user
    -- so just start it again and retry...
    wordopen;
    mydocs := CLIENT_OLE2.get_obj_property(obj_hnd,'Documents');
    END;
    END;
    END;
    If the procedure test is called once then the Word application is started and the procedure performs some work. The procedure could be called several times on the same Word instance but fails in case the user closes the Word application because the procedure does not get an exception or error from WebUtil's get_obj_property function. Only a JACOB Java exception is logged in the Java console of the user's computer - the PL/SQL code has no way of knowing that an error has occurred.
    Possible solution / patch for webutil.pll:
    The webutil.pll can be patched to throw an exception if it is given an invalid object handle. In webutil.pll version 1.0.2 in get_object_property, line 1205, just add the condition "(v_javaHandle IS NULL) or " at the beginning of the if-statement in that line so that an OLE_ERROR will be raised if v_javaHandle is NULL:
    if (v_javaHandle IS NULL) or (v_javaHandle = 0) or (v_javaHandle='') or (v_javaHandle=-1) then     
    raise OLE_ERROR;      
    end if;     
    Can you confirm the error and re-release a patched webutil.pll at a later time?
    Regards,
    Andreas Leidner
    infoteam GmbH Berlin

    Hi
    It is mentioned in webutil doc that, you must regenerate webutil.pll before using it; otherwise you’ll encounter error ORA-06508 when running a form with the attached library.
    Hope this helps...
    Regards,
    Amatu Allah

  • Error Handling in JDBC Adaptor - Without BPM

    Hi friends,
    My problem is like this. Scenario is File -> Xi -> JDBC.
    here i didn't used BPM at all.
    My interface is working fine.
    right now i am not doing any error handling for 'Primary key violation, refrential intigrity etc.. '.
    if this type errors encountered i going to adapter monitoring and looking out the issue.
    Now the client requirment is
    whenever this type of errors occured Client should be notified Via email along with error description.
    Is there anyway to do this ?

    Hi Suresh,
    You can setup the Alerting framework of XI to trigger alerts. Alert rules can be set to raise alerts in case of JDBC Adapter Errors.
    Check these links....
    http://help.sap.com/saphelp_nw04/helpdata/en/3f/81023cfa699508e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/80/942f3ffed33d67e10000000a114084/frameset.htm
    Thanks & Regards,
    Renjith
    An addition to what i just said...You have to be on SP14 for this...
    Message was edited by: Renjith Andrews

  • What is Considered Best Practice for Error Handling in Components?

    What would be the best approach to handling errors in custom (possibly composite) components?
    I see three different possibilities:
    Having the error handling funciton within the component. The problem is that this is not adaptable to the consumers error handling setup (i.e. logging to database, redirecting to a pretty error screen, etc.).
    Passing in an error function as a parameter. The problem here is how to have the externally defined error function interact with external elements that are not defined within the component, i.e. passing the error or fault object to a logging class, or something similar, of which the component knows nothing about.
    Referencing the external error handling methods directly from within the component. (Of course that's shabby programming, just listing as a technical option.)
    How do you solve this?
    My goal is to have a versatile custom component that can utilize any given consumer's error handler.
    Thanks,
    Mike

    or define a customized event and dispatch it when error occur, then you can just listen to it outside

Maybe you are looking for