I dont want to throw an exception !!

Hi,
          I have a stateless session bean, that in turn calls BMP entity bean. The
          transaction attribute for session bean is Required and that of entity bean
          is Supports.
          Now if some database error occurs, I want to catch that exception in the
          stateless bean, and dont want to rethrow it. How can I do it. Weblogic still
          throws the exception.
          The code of session bean looks something like this :
          try
          // Call entity bean
          catch (Exception e)
          // Dont do anything !!
          on the client program, that calls the session bean, am getting this
          exception :
          java.rmi.UnexpectedException: Unexpected exception in
          src.com.etouch.scheduler.stateless.schedulerapi.impl.SchedulerApiBean.create
          Schedule():
          javax.transaction.SystemException: Transaction not active
          at weblogic.jts.internal.TxContext.commit(TxContext.java:251)
          at
          weblogic.ejb.internal.StatelessEJBObject.postInvokeOurTx(StatelessEJBObject.
          java:88)
          at weblogic.ejb.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:758)
          at
          src.com.etouch.scheduler.stateless.schedulerapi.impl.SchedulerApiBeanEOImpl.
          createSchedule(SchedulerApiBeanEOImpl.java:62)
          at
          src.com.etouch.scheduler.stateless.schedulerapi.impl.SchedulerApiBeanEOImpl_
          WLSkel.invoke(SchedulerApiBeanEOImpl_WLSkel.java:88)
          at
          weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerObjectAda
          pter.java, Compiled Code)
          at
          weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicRequestHandle
          r.java:77)
          at
          weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:1
          5)
          at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
          ; nested exception is:
          javax.transaction.SystemException: Transaction not active
          javax.transaction.SystemException: Transaction not active
          Exception in thread "main" Process Exit...
          What am I doing wrong here ? The idea is, I dont want the client to know
          about this error.
          Thanks
          Amit
          

Amit,
          I believe that what is actually happening here is that the transaction is
          not actually being rolled back until the session bean method, which is
          participating in the transaction, is completing. I too am having this
          problem and currently have not found a solution short of adding an extra
          layer which is not an option. You also appear to be having another problem
          with the transaction upon which I cannot comment.
          Any help would be greatly appreciated.
          Regards
          Conrad Rowlands
          Callards Technology.
          "Amit" <[email protected]> wrote in message
          news:[email protected]...
          > Hi,
          > I have a stateless session bean, that in turn calls BMP entity bean. The
          > transaction attribute for session bean is Required and that of entity bean
          > is Supports.
          > Now if some database error occurs, I want to catch that exception in the
          > stateless bean, and dont want to rethrow it. How can I do it. Weblogic
          still
          > throws the exception.
          > The code of session bean looks something like this :
          > try
          > {
          > // Call entity bean
          > }
          > catch (Exception e)
          > {
          > // Dont do anything !!
          > }
          >
          > on the client program, that calls the session bean, am getting this
          > exception :
          >
          > java.rmi.UnexpectedException: Unexpected exception in
          >
          src.com.etouch.scheduler.stateless.schedulerapi.impl.SchedulerApiBean.create
          > Schedule():
          > javax.transaction.SystemException: Transaction not active
          > at weblogic.jts.internal.TxContext.commit(TxContext.java:251)
          > at
          >
          weblogic.ejb.internal.StatelessEJBObject.postInvokeOurTx(StatelessEJBObject.
          > java:88)
          > at weblogic.ejb.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:758)
          > at
          >
          src.com.etouch.scheduler.stateless.schedulerapi.impl.SchedulerApiBeanEOImpl.
          > createSchedule(SchedulerApiBeanEOImpl.java:62)
          > at
          >
          src.com.etouch.scheduler.stateless.schedulerapi.impl.SchedulerApiBeanEOImpl_
          > WLSkel.invoke(SchedulerApiBeanEOImpl_WLSkel.java:88)
          > at
          >
          weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerObjectAda
          > pter.java, Compiled Code)
          > at
          >
          weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicRequestHandle
          > r.java:77)
          > at
          >
          weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:1
          > 5)
          > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
          > ; nested exception is:
          > javax.transaction.SystemException: Transaction not active
          > javax.transaction.SystemException: Transaction not active
          > Exception in thread "main" Process Exit...
          >
          >
          > What am I doing wrong here ? The idea is, I dont want the client to know
          > about this error.
          > Thanks
          >
          > Amit
          >
          >
          >
          

Similar Messages

  • Apparently my Mac is too old now to sync with newer products. How do upgrade the software/hardware so i can keep up to date. I love my mac and dont want to buy a new one. Is it possible?

    Help! I am struggling and im really not a wizz with technology. I must have missed the morph into the new world! I have a macbook (i think!) and i found that im still running off the version 10.5.8. I have just plugged in my new ipad, and tried to get it synced with Itunes and it said i needed a newer version.
    Am i able to upgrade to a newer version and if so, how do i do it...i really dont want to throw out this computer because it is awesome...can someone please help me?

    To be able to connect with the devices that need a newer version of iTunes, you are first going to need to upgrade you OS X.  To do this from where you are at, first you need to make sure that your computer meets the minimum requirements for OS X Snow Leopard which you can find here http://support.apple.com/kb/SP575 and then after verifying that it can, you then need to order the Snow Leopard CD from Apple to do the upgrade.  You can purchase the CD from them for $19.99 and when it gets to your house, you can insert the CD in the drive and press the "C" key while booting your computer.  Then you'll get the install wizard from the CD which will give you directions you need to install Snow Leopard on your computer.  After getting that installed, make sure you update the software on your computer and it will get you what you need to be able to Sync your devices.  After you get Snow Leopard installed, if you wanted to go further you could then upgrade to 10.7 Lion or 10.8 Mountain Lion if your computer can handle those as well, and you can do that right from the App Store that will be available to you from Snow Leopard and you don't have to order a CD for those.

  • Throwing an exception from XSLT

    Just wanted to share a finding with the Oracle XDB community and possibly suggest an enhancement to the xdb product development team (care of MDRAKE).
    I had a scenario where I wanted to throw an exception from the XSLT.
    A little Googling revealed this helpful post:
    http://weblogs.asp.net/george_v_reilly/archive/2006/03/01/439402.aspx
    ...so I gave it a shot.
    In my XSLT, I have a <xsl:choose> block with the following <xsl:otherwise> block:
    <xsl:otherwise>
        <xsl:message terminate="yes">Unknown Document Type</xsl:message>                          
    </xsl:otherwise>I used a stub test to run this through, giving it a file which would exercise the exception:
    select xmltype(bfilename('XML_RESOURCES', 'data.xml'),0).transform(xmltype(bfilename('XML_RESOURCES', 'sanitize_xml.dev.xsl'),0))
    from dual;..and to my 'joy', I did get an exception:
    ORA-30998: transformation error: execution of compiled XSLT on XML DOM failedHmm...would of been nicer to get something like what Eclipse/Xalan pops out:
    file:/H:/eclipse_indigo_workspace/XSLT/sanitize_xml.xsl; Line #28; Column #59; Unknown Document Type
    (Location of error unknown)Stylesheet directed termination...i.e. my custom error message "Unknown Document Type" isn't output by Oracle.
    Just to be safe, I tried a file which would NOT exercise this xsl:otherwise block and it did run through OK.
    So, could XDB report a better error?
    Thoughts?

    SQL> VAR XSL VARCHAR2(4000)
    SQL> --
    SQL> begin
      2    :XSL :=
      3  '<?xml version="1.0" encoding="UTF-8"?>
      4  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      5     <xsl:output method="xml" indent="yes"/>
      6     <xsl:template match="/">
      7             <Result>
      8                     <xsl:choose>
      9                             <xsl:when test="Input=''1''">
    10                                     <Output>1</Output>
    11                             </xsl:when>
    12                             <xsl:when test="Input=''2''">
    13                                     <xsl:message>The value is 2</xsl:message>
    14                                     <Output>2</Output>
    15                             </xsl:when>
    16                             <xsl:when test="Input=''3''">
    17                                     <xsl:message terminate="no">The value is 3</xsl:message>
    18                                     <Output>3</Output>
    19                             </xsl:when>
    20                             <xsl:otherwise>
    21                                     <xsl:message terminate="yes">Invalid value</xsl:message>
    22                                     <Output>Bad Input</Output>
    23                             </xsl:otherwise>
    24                     </xsl:choose>
    25             </Result>
    26     </xsl:template>
    27  </xsl:stylesheet>';
    28  end;
    29  /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.00
    SQL> select XMLTRANSFORM(XMLTYPE('<Input>1</Input>'),XMLTYPE(:XSL))
      2    from dual
      3  /
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <Result>
      <Output>1</Output>
    </Re
    Elapsed: 00:00:00.01
    SQL> select XMLTRANSFORM(XMLTYPE('<Input>2</Input>'),XMLTYPE(:XSL))
      2    from dual
      3  /
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <Result>
      <Output>2</Output>
    </Re
    Elapsed: 00:00:00.00
    SQL> select XMLTRANSFORM(XMLTYPE('<Input>3</Input>'),XMLTYPE(:XSL))
      2    from dual
      3  /
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <Result>
      <Output>3</Output>
    </Re
    Elapsed: 00:00:00.01
    SQL> select XMLTRANSFORM(XMLTYPE('<Input>4</Input>'),XMLTYPE(:XSL))
      2    from dual
      3  /
    ERROR:
    ORA-30998: transformation error: execution of compiled XSLT on XML DOM failed
    no rows selected
    Elapsed: 00:00:00.01
    SQL>
    SQL>The actuall error is not unreasonalbe. The Execution did fail beacuse you terminated it.. Contacting Oralce Support may be a little excessive...
    Now with respect to message the question is where...
    We 'could' output into the same buffer as is used by DBMS_OUTPUT, but that has limits in terms of the amount of output that can be generated.
    We could write it to the trace file, but that may be difficulat for a developer to get to
    We could write it to a log file in the XDB repository, but where and how to name it...
    We could another parameter to XMLTransform, which would be a Message Buffer
    All of these are in effect enhancements..
    BTW I checked with XML Spy and they seem to ignore message too, so I'm wondering how widely used this is...
    We cannot add it to the output of the XSL since XMLTransform defines the output of the XML to be well formed XML, and adding a random set of text nodes would viloate that rule..

  • Throwing an Exception

    I have a class for adding special datatypes. Within this class I have a check to test whether or not the two objects can be added. If they cant be added I want to throw an exception (i think). How would I do this.

    throw new IllegalArgumentException("can't add the types!");Or you could create your own RuntimeException.

  • Office 365 Sandbox Solution EventReceiver throwing Remote Exception in ItemAdding

    Hi,
    I created a sandbox webpart for O365 with EventReceivers with ItemAdding for Document Library and while i upload a document to library in O365  sharepoint site application throws below exception:-
    System.Runtime.Remoting.RemotingException: Server encountered an internal error. For more information, turn off customErrors in the server's .config file.
    Server stack trace: 
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.SharePoint.Administration.ISPUserCodeExecutionHostProxy.Execute(Type us
    Same code works perfectly on my Development machine, Please help. Below is the Code
    base.EventFiringEnabled = false;
    bool isFile = (properties.AfterProperties["vti_filesize"] != null);
    if (isFile == true)                   
    SPWeb currentWeb = properties.OpenWeb();
    // Get foldername from url like Document/EC10001/filename.txt                       
    string folderName = properties.AfterUrl.Split(new char[] { '/' })[1];
    SPList spList = currentWeb.Lists[properties.List.ID];                       
    SPQuery spQuery = new SPQuery();                       
    spQuery.Query = "<OrderBy><FieldRef Name='Modified' Ascending='FALSE'/></OrderBy>";
    //Getting the folder object from the list                       
    SPFolder folder = spList.RootFolder.SubFolders[folderName];
    //Set the Folder property                       
    spQuery.Folder = folder;
    int fileSequenceId = 0;                      
    SPListItemCollection items = spList.GetItems(spQuery);
    if (items.Count > 0)                       
    string documentID = items[0]["DocumentID"] != null ? items[0]["DocumentID"].ToString() : string.Empty;
    if (!string.IsNullOrEmpty(documentID))                           
    string splitNumber = documentID.Split(new char[] { '-' })[1];                               
    fileSequenceId = Convert.ToInt32(splitNumber) + 1;                           
    else                           
    properties.ErrorMessage = "Unable to generate Document Id";                               
    properties.Cancel = true;                           
    else                       
    fileSequenceId = 1;                       
    // Set DocumentID like EC10001-001                       
    properties.AfterProperties["DocumentID"] = folderName + "-" + fileSequenceId.ToString(ConstantsList(currentWeb, "DocumentID"));      
    // Retrive "EEC000" string from Constant List               
    properties.AfterProperties["vti_title"] = folderName + "-" + fileSequenceId.ToString(ConstantsList(currentWeb, "DocumentID"));   
    // Retrive "EEC000" string from Constant List                
    base.EventFiringEnabled = true;
    Thanks,
    Pranay Chandra Sapa

    Hi,
    According to your description, my understanding is that when you upload document in Office 365 site, the event receiver in sandbox solution throws error.
    Per my knowledge, if you want to use event receiver in Office 365 environment, you need to use remote event receiver instead the normal event receiver in an app.
    Here are some detailed articles for your reference:
    Create a remote event receiver in apps for SharePoint
    Handle events in apps for SharePoint
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • I upgraded my PC from Win7 to Win8 and installed itunes, when I plug my ipod in it wants to erase it as its sync'd to another PC.  How do I fix this a I dont want to loose my playlists?

    I upgraded my PC from Win7 to Win8 and installed itunes, when I plug my ipod in it wants to erase it as its sync'd to another PC.  How do I fix this a I dont want to loose my playlists?

    The iphone is not a storage/backup device.  The sync is one way - computer to iphone.  The exception is itunes purchases:  File>Transfer Purchases
    Copy everything from your other library/computer, or your backup copy, to your new library/computer

  • How to Throw/Catch Exceptions in BPM

    Hi All,
    I've seen a couple articles that talk about how to Throw/Catch an execption in a BPM. My question has two parts:
    1) RFC Call: I was able to catch an Fault Message in an exception step when calling an RFC (Synchronous Interface). What I wanted to do is use the fault message (exception) and store it in a DB for later review.
    2) IDOC: I'm sending an IDOC to R3 from a BPM. The send step is enclosed in a block w/ an exception. The send step is throwing an error (IDOC adpater system error), but the exception is never thrown. My question is: when the error occurrs at the adapter level does it still throw an exception in a BPM?
    Thanks for any tip/advice/anything!
    Fernando.

    Hi Fernando,
    1) Define a send step in the exception branch.
    2) If u send a IDoc from R/3 to XI and the IDoc adapter is running to an error of course there cant be an exception in ur business process. Usually the IDoc adapter sends back status back up via ALEAUD. In case of success IDoc should have then '03', if the adapter cannot send anything the IDoc should remain at '39'. U should send a ALEAUD in case of exception of BPM switching to status '40', in case of success to '41'.
    Regards, Udo

  • Throwing Runtime Exceptions from BPM. How?

    Hi !
    I want to make appear a red flag in the SXMB_MONI as a result of a custom condition inside a BPM. I tried with the control step, but it makes no "red flag".
    Should I make a transform step between 2 dummy message types with a UDF that throws the runtime exception there?? is there another way ?? We want a red flag as a result of a expired deadline while waiting a file adapter transport acknowledgement.
    Thanks !!
    Matias.

    Matias,
    As you said before you want the BPM to be errored out if it reach the deadline, am I right. In control step if u say cancel process it equivalent to logically deleting the work items, so obviously you will get an succesfull message. What I suggest you to do is in  Deadline branch - control branch select throw exception. The exception name has to be defined in Block level. So if you throw an exception it will look for the exception branch in the same block level if not the higher(super)block level, if it couldn't find the exception branch it will run out to error. Actually the exception branch is used to catch that exception and continue the rest of the process, so i think there is no need for defining the exception branch itself.
    Hope it helps you!!!
    Best regards,
    raj.

  • Problem with chapters playing when i dont want them to

    OK let me explain what I have going here. I have 4 timelines for seperate videos in my project. Each has a motion button on the main menu that will play each one independantly and then return to the main menu and a "play it all" button the will play them in order. Ok all that works fine except for one thing. I want to video that shows in my thumbnails on the main menu to be a seperate video than what is actually in the feature DVD so after searching the forum I found a solution that is working. What I did was to take the video I wanted to use for the thumbnails and add that to the end of each timeline as a new chapter and then added a poster frame to control what showed in the thumbnail.
    So to review.....each timeline had two chapters one that I want to show in the feature DVD and one that I do not.
    By using the end actions oneach of the first videos in each timeline I can get the DVD to play from the beginning and skip the video I dont want seen. However, .....and here is the reason for my post FINALLY....when i use the chapter skip on the preview it of course skips to the video I dont want shown.....the last video on each timeline. So instead of having 4 chapters I now have 8....4 of each i would like to not be accessable at all.
    Any way to to what I am wanting to do which essentially is tell Encore to skipthose chapters on the chapter skip button on the player??
    thanks for any help in advance!!!!!!!!!!!

    Unfortunately not, if you are using that workaround. I can offer two suggestions:
    1. Create your entire motion menu background (including the thumbnail animations) in Premiere or After Effects, then use that as a background video on your menu that is set up with buttons containing
    only subpicture layers (no other layers, including thumbnail layers).
    2. Keep your current workaround and add user operations to the timeline so that Next/Previous chapter navigation is prohibited.

  • Dont want command window....

    hi guys,
    I have a swing application that runs from a jar. now i dont want my application to throw up a command window when running. i tried offering the solution of creating an executable jar but that wasnt well accepted though it did the trick. i want to know if i can have a variable in a config file and based on that value turn on or hide the command window during start up? is there some way to do this?
    thanks
    sudarshan

    Launch the appliction using javaw instead of java.
    /Kaj

  • Dont want see default buttons on custom container ?

    Hi Rich,
    Thanks for your solution, but i dont want to see the icons which are showing bydefault on top of the container...
    Is it possible to avoid...
    Can you please let me know.
    regards
    jaya

    Hi Rich,
    Thanks for your solution, but i dont want to see the icons which are showing bydefault on top of the container...
    Is it possible to avoid...
    Can you please let me know.
    regards
    jaya
    Hi, you can do this using a custom container instead of the docking container. If you have a screen, go into screen painter and create a custom control in that screen, then in the PBO, you can reuse that coding and just use the custom container instead of the docking. Make sure to name the custom container in the screen as 'TE_CONTAINER'. This is what I've referenced in the code below.
    data: cc_container type ref to cl_gui_custom_container.
    create object cc_container
             EXPORTING
                   CONTAINER_NAME    = 'TE_CONTAINER'.
    create object text_editor
    exporting
    parent = cc_container.
    xtext = 'http:
    www.sap.com'.
    append xtext to itext.
    call method text_editor->set_text_as_r3table
    exporting
    table = itext
    exceptions
    others = 1.
    Regards,
    Rich Heilman

  • Export with BiarEngine.jar works, using the API it throws an exception

    Hello,
    I'm using BiarEngine.jar to export from my CMS. it works fine.
    Now I want to use the API to get someting more handy, but I receive an exception (NoSuchFieldError) as if I had a mismatch between versions.
    I'm stuck with it, if somebody has an idea...
    Thanks a lot.
    Alain
    Here is the java code:
    IExportOptions oExportOptions = BIARFactory.getFactory().createExportOptions();
    oExportOptions.setIncludeSecurity(false);
    oExportOptions.setIncludeDependencies(true);
    oExportOptions.setCallback(
         new IExportCallback()
              public void onSuccess(int id)      {...}
              public void onFailure(int id, BIARException biarException) {...};
    BIAROutput oBIAROutput = new BIAROutput( oEntrepriseSession, "c:\myFile.biar", exportOptions );
    At this point it throws the exception:
    Exception in thread "main" java.lang.NoSuchFieldError: SI_MODELCUID_SET
         at com.businessobjects.sdk.plugin.desktop.deltastore.internal.DeltaStore.setupProperties(DeltaStore.java:188)
         at com.businessobjects.sdk.plugin.desktop.deltastore.internal.DeltaStore.unpack(DeltaStore.java:37)
         at com.crystaldecisions.sdk.occa.infostore.internal.al.continueUnpack(Unknown Source)
         at com.crystaldecisions.sdk.occa.infostore.internal.al.startUnpack(Unknown Source)
         at com.crystaldecisions.sdk.occa.infostore.internal.InternalInfoStore.queryHelper(Unknown Source)
         at com.crystaldecisions.sdk.occa.infostore.internal.InternalInfoStore.query(Unknown Source)
         at com.crystaldecisions.sdk.occa.infostore.internal.at.query(Unknown Source)
         at com.businessobjects.sdk.biar.internal.XSDManager$RepositoryXSD.retrieveXSDVersions(XSDManager.java:204)
         at com.businessobjects.sdk.biar.internal.XSDManager$RepositoryXSD.<init>(XSDManager.java:194)
         at com.businessobjects.sdk.biar.internal.XSDManager$XSDCache.getXSD(XSDManager.java:365)
         at com.businessobjects.sdk.biar.internal.XSDManager.<init>(XSDManager.java:55)
         at com.businessobjects.sdk.biar.BIAROutput.<init>(BIAROutput.java:73)

    >
    Just need to confirm if the ANT script can be run against individual OSB project than OSB configuration project?
    >
    It is possible. I'm going the same way here. However, I remember I needed to contact support because it was not a standard feature of the Ant task. They provided me with the patch that allowed me to use -configSubProjects parameter in export.
    >
    Can we have multiple OSB configuration projects on the OSB server ?
    >
    I don't think so.

  • JNI Application running in ms-dos but throws an exception in applet

    Hi! I have a java application which calls a DLL using the JNI. This works perfect if I execute the java program from my command line (in ms-dos) But when I try to do it in an applet, it indeed runs and do everything ok, but at the end of the execution I get a EXECUTION_EXCEPTION.
    This is how is working:
    1.- jnidllmyclass, this is where I call the native method of my DLL
    2.- intermediate DLL which writes to files to c:\temporal and it calls several functions from other DLL
    3.- other DLL which writes more files (among other things)
    4.- applet class with a call to jnidllmyclass
    Now the DLL what does is to open a connection to a usb scanner, then send commands to it to scann somethings, save front and back images to c:\temporal (obviously, all of this is done in the user system, using certificates) and write other file and close the connection. This works! it write the images well and write everything... but after that the exception arises... I have doubt of what is it, because if it does all, what is causing the exception?
    Thanks for your help!

    Hi! Applet can access the DLL. The scanners works, but the C DLL throws an exception. Nevertheless, I've managed to see what was going on. When you click a JButton in a GUI, it enters only one to the actionlistener, but if this is done in an Applet, enters twice, so... the first time worked fine, but the second no because there was nothing to scann.
    This theme is a bit creepy, if you want help just ask! I give snippets, not just advices... I hate those people, so fell free to ask.
    Greetings!

  • FM used in background job throws an Exception-NO_BATCH

    Hi,
    I have one normal ABAP report with selection screen, where selection parameters are file names and they are used for uploading data from excel to internal table and then internal table to excel respectively.
    Now I want to put this as a background job. So I saved the variant and now while running the job there is an exception.
    Reason for the same as I could find out is:
    while uploading function module (KCD_EXCEL_OLE_TO_INT_CONVERT or ALSM_EXCEL_TO_INTERNAL_TABLE) is called, it has some front-end  services called.
    That is in case of first function module, it is CLPB_IMPORT which in turn calls WS_QUERY where GUI_EXIST is checked and there it throws an exception.
    And in the later case it is cl_gui_frontend_services class and its some method is called.
    So basically, frontend services are called in any case and I still want this as a background job.
    Can Anyone clear it conceptually?

    Hello Krupa,
    The rule is pretty much simple: <i>Anything that you do in batch / background, cannot have anything to do with the front-end / desktop.</i>
    The Excel sheet you use is an application that runs on the Frontend, right? So you cannot do it in batch. The reason, to put it crudely, is that a background job is run by a different workprocess altogether and that work process is not capable of accessing the front-end. Ideally, a background job should be run-able even without a GUI!!
    SO what you can do in a background job, is to operate on the files present on the application server (that is where the job runs).
    Hope that is clear. If not, get back.
    Regards,
    Anand Mandalika.
    Regards,
    Anand Mandalika.

  • Performance costs of throwing an Exception

    Hi people. I was just reading another post around here, and I became curious about how much the Exception mechanism could become an overhead... I made a simple (REALLY simple) little test class, and I was shocked to perceive that actually throwing an Exception is cheap (I always thought that it would be just the opposite...). Try running this later:
    public class Test {
         public boolean something() {
              return true;
         public void nothing() throws Exception {
              throw new Exception("Voila");
         static public void main(String[] algo) {
              Test test = new Test();
              long now = System.currentTimeMillis();
              test.something();
              System.out.println("boolean method took " +
    (System.currentTimeMillis() - now) + " milliseconds.");
              now = System.currentTimeMillis();
              try {
                   test.nothing();
              } catch (Exception e) {
                   System.out.println("exception method took " +
    (System.currentTimeMillis() - now) + " milliseconds.");
    }and here are some results I got:
    1)
    boolean method took 0 milliseconds.
    exception method took 0 milliseconds.
    2)
    boolean method took 0 milliseconds.
    exception method took 0 milliseconds.
    3)
    boolean method took 0 milliseconds.
    exception method took 0 milliseconds.
    Of course, I assume that when the stack grows a bit, the result could be quite different. I ran this on a AMD 900 MHz, 512Mb RAM, JDK 1.4.1_01 under Eclipse.
    PS: Excuse me for my bad English :)
    falowwwwww

    Yeah, I guess I was always right...
    Here's the (fixed) code:
    public class Test {
         public boolean something() {
              return true;
         public void nothing() throws Exception {
              throw new Exception("Voila");
         static public void main(String[] algo) {
              Test test = new Test();
              long now = System.currentTimeMillis();
              for (int i=0; i<Integer.MAX_VALUE; i++) {
                   test.something();
              System.out.println("boolean method took " + (System.currentTimeMillis() - now)
                   + " milliseconds.");
              now = System.currentTimeMillis();
              for (int i=0; i<Integer.MAX_VALUE; i++) {     
                   try {
                        test.nothing();
                   } catch (Exception e) {
              System.out.println("exception method took " + (System.currentTimeMillis() - now)
                   + " milliseconds.");
         }The boolean loop took twelve seconds to finish... The exception loop ran for almost 18 minutes (when I stopped it! it didn't even complete!)
    If anyone want to, run the code and post here the real results. Thanks!!
    I guess that "our great designers" here at my company will lose their jobs... Well I think they deserve it. If only they payed attention to me at the beggining when I complained about throwing lots of unnecessary exceptions... eheheheh
    PS: Excuse me for the bad English again!!
    falow!!!!!!!

Maybe you are looking for