Evaluating a condition multiple times

Suppose I have a SQL query or PL/SQL code that I am using to conditionally fire components during show/accept processing.
This SQL query/PL/SQL code is expensive, takes a long time to run.
So, my question is:
How does the HTML DB engine work? Does it evaluate the condition once per show/accept processing and then "cache" the result (true/false) so that any other component can just re-use that answer without re-evaluating the (expensive) condition?
Or does it re-evaluate the condition over and over again? (hopefully not)
Thanks

The result of the condition would change between evaluation points if it referred to values in session state and stuff.
But if the query/code were invariant with respect to HTML DB, it could cache the result.
The shared pool will only cache the execution plan so that the SQL will not be hard-parsed the time, thats a small fraction of a second anyway.
Coming to think of it, if I am sure the condition will not change then I could just as well run it once-per-page using a Before Header computation to set a hidden item and change my subsequent conditions to just read this hidden item!
Thanks for your input.

Similar Messages

  • I have agreed and accepted the terms and conditions multiple times

    I have agreed and accepted the terms and conditions multiple times and I am still being asked to accept. All I want to do is watch the new episode of Glee and I am highly considering doing so illegally or getting a ******* hulu-plus account because iTunes for some reason does not want me to purchase anything. I have been playing along in this treacherous cycle for a ******* half-hour. How do I make this stop?

    Hello ms450,
    I would report an issue with the purchase directly to the iTunes Store support with this article:
    How to report an issue with your iTunes Store, App Store, Mac App Store, or iBookstore purchase
    http://support.apple.com/kb/ht1933
    Cheers,
    Sterling

  • I'm trying to download an app on my iPhone, however I'm being told that the terms and conditions have changed and i must look at them before i can download.  I've gone through the terms and conditions multiple times and i can't find an 'accept' option?

    I'm trying to download an app on my iPhone, however I'm being told that the terms and conditions have changed and i must look at them before i can download.  I've gone through the terms and conditions multiple times and i can't find an 'accept' option?

    Hello jody5758
    Continue your troubleshooting with the article below. IT will walk you through checking the Date & Time as well as checking the settings of your router to ensure a proper connection.
    Can't connect to the iTunes Store
    http://support.apple.com/kb/ts1368
    Regards,
    -Norm G.

  • Time Evaluation with multiple time events

    Dear Friends,
    I have an issue in our current project. Kindly try to help me with a solution.
    We are working on Time Management module with Positive Time Recording method and evaluation- India. (Payroll module is not implemented)
    My issue is:
    Evaluation with multiple time events in a day: In our project, we have a scenario like the employees record multiple clock in and clock out times for one day and are uploaded into infotype 2011. But during time evaluation, only first Time event that is P10 (Clock In) and the last Time event P20 (Clock-out) in a day should be considered for evaluation, ignoring any multiple time entries in between duration in the table TEVEN (Infotype 2011).
    Pls let me know how this requirement can be met. Do we need to define any new PCR’s or create any functions? If yes, pls tell me the process in detail as I am new and implementing Time management (Positive Time recording with Evaluation) for first time. Try to help me as soon as possible.
    Thanks & Regards,
    Chiranjeevi
    Edited by: chiran reddy on Feb 15, 2008 2:20 PM

    is it not possible to enter only the first p10 and last p20 from the time systems into 2011.

  • While upgrading my iPhone5 OS to iOS 7 'Term & Condition' page for iCloud  keep coming even after Agreeing multiple times.

    Hi,
    I am upgrading the OS of my iPhone5 to iOS7 directly from the device.
    It downloaded and started upgrade. During the upgrade process I got stuck in 'Terms & Condition' for iCloud.
    I clicked on 'Agree' buttom multiple times. Still itnstallation is not moving forward. It always remains in the same page.
    Now I cannot come out the installation process. Even the 'Disagree' option is not taking me out from the 'Terms & Condition' page.
    What may be the possible reason? Am I going wrong anywhare?
    Regards,
    Rajesh

    There are various solutions to this posted in this discussion: https://discussions.apple.com/thread/5321627?start=0&tstart=0.  Perhaps you'll find one that will work for you.

  • How to trigger Condition Access sequence multiple times for one line item?

    Hi,
    We have a situation that, User will enter a Promo code (custom Field) in Sales order Header Additional data B tab to apply discount for line items.
    Logic goes like this:
    1. For each Promo code .. there may be multiple sale deals (Max 3 at this point).
    2. For each line item (refering to tkomp table) we have to apply the sale deals (found above) the Condition access sequence will pick the right sale deal to apply the line item.
    3.we have enhanced the tkomp structure to hold the sale deal.
    Challenge:
    As we have the standard logic to trigger the condition access sequence once for each line item, how we can apply 3 sale deals for single line item. Is there any logic or way to trigger the condition access sequence multiple times for single line item with diffrent sale deals. ~ There may be one valid sale deal for one line.
    Functional team maintained diffrent access tables in the access sequence!!!
    Fnds, please help me to get some clue
    Thanks,
    Sunil Y

    Hi Eduardo , Thanks for the response.
    I am trying to explain again, this is the requirment given by the functional guys.
    we have Promo code in Hearder Addtional data B tab --> Have to retrieve Sale Deals -->
    At this point of time we may have at max 3 Sale Deals. we don't know which sale deal is vallied for which item we have in TKOMP.  We have enhanced the TKOMP structure to hold one sale deal only (ZZPROMO).
    We have enhanced USEREXIT_PRICING_PREPARE_TKOMP in RV60AFZZ to populate the value in TKOMP. Then it will go for diffrent access sequence to find the proper condition.
    Our challenge is that, for each line item we have 3 sale deals, we don't know which one is valid for which line. but we have to apply the vallied sale Deal to the line items.  Line item 10  may have Sale Deal 2 , item 20 may have Sale Deal3 and 30 may have sale deal 1.
    We may have solution, by fixing some thing in the code or through config. But i am confused that is it a valid requirment?
    Please help me ...
    Thanks,
    Sunil Y

  • Reg: To get One employee multiple times based on condition

    Dear Friends,
    I need your help regarding this Requirement.
    Need to display the contractual years for every employee in the valueset.
    If the emp is hired on 29-Feb-2004, then his contractual years should be as follows:
    1) 29-feb-2004 to 28-feb-2005
    2) 1-mar-2005 to 28-feb-2006
    3) 1-mar-2006 to 28-feb-2007
    4) 1-mar-2007 to 29-feb-2008
    5) 29-feb-2008 to 28-feb-2009....... and so on up to current year ( *9* times)
    If hired on 1-Jan-1997, then *16* times
    I have developed the above logic in CASE <logic> END statement. The logic is depends on row number partitioned by Employee number. So now i need to incorporate it in SELECT statement since it will be used in Valueset. For this i need multiple rows for each employee as above number of times. So that i can create view accordingly.
    Please do needful...
    Thanks in advance..

    If the sound has to be played again but is still being played by another event, the setFramePosition() method resets the sound and the first playing instance is cut off.
    A workaround would be that each object that needs to play this sound would get its own copy, but that is not feasible due to heavy memory consumption.
    So here it goes: How can I play a single sound multiple times at the same time? Is that possible?Ummmm, if you're using a clip, you'll have to maintain one copy per object that needs to play the sound concurrently. You could keep one master copy, and then create copies of the clip as necessary to play them, and then just dump the copies to decrease memory consumption.
    A second idea would be to write your own Clip class. Esentially, all you would need to do is dump some sound data onto a TargetDataline to play it. It'll handle the buffering and playing at the correct speed itself. If that's all you did, you should be able to dump multiple times from the same instance and play it multiple times.
    Obviously, that's just a theory. In practice, it may not work that way...

  • Bapi_po_create1 is giving same system messages  multiple time in the joblog

    Hi Experts,
    Bapi_po_create1 is giving same system messages multiple times in the job log when we ran the program in the background
    can u plz suggest how to prevent these multiple appearances of same messages.
    I am pasting the code below whn i ran this program in backgorund job log is having the messages.
    Date       Time     Message text                                                                 Message class Message no. Message type
    08/06/2009 08:11:53 Job started                                                                       00           516          S
    08/06/2009 08:11:53 Step 001 started (program ZZZTEST, variant &0000000000008, user ID BREDDY)        00           550          S
    08/06/2009 08:11:54 Commitment plan contains no account assignment data                              MECP          020          S
    08/06/2009 08:11:54 Commitment plan contains no account assignment data                              MECP          020          S
    08/06/2009 08:11:54 Status "Initial Block" of material 20111 does not allow external procurement      ME           053          E
    08/06/2009 08:11:54 Status "Initial Block" of material 20111 does not allow external procurement      ME           053          E
    08/06/2009 08:11:54 Source not included in list despite source list requirement                       06           722          E
    08/06/2009 08:11:55 Pricing/euro: Attention: Euro Customizing not maintained                          VH           777          S
    08/06/2009 08:11:55 Pricing/euro: Attention: Euro Customizing not maintained                          VH           777          S
    08/06/2009 08:11:55 Status "Initial Block" of material 20111 does not allow external procurement      ME           053          E
    08/06/2009 08:11:55 Purchase order still contains faulty items                                       MEPO          000          E
    08/06/2009 08:11:55 Job finished                                                                      00           517          S
    Edited by: bhavani prasad kotharu on Aug 6, 2009 3:09 PM

    HERE IS THE CODE OF THE PROGRAM, WE R JUST PASSING SOME PO DATA TO THE BAPI_PO_CREATE1,ON RUNNING THIS PROGRAM IN BACKGROUND SAME SYSTEM MESSAGES ARE APPEARED MULTIPLE TIMES,----
    REPORT zzztest.
    DATA :    lwa_bapimepoheader TYPE bapimepoheader
             ,lwa_bapimepoheaderx TYPE bapimepoheaderx
             ,li_bapimepoitem TYPE STANDARD TABLE OF bapimepoitem
             ,lwa_bapimepoitem TYPE  bapimepoitem
             ,li_bapimepoitemx TYPE STANDARD TABLE OF bapimepoitemx
             ,lwa_bapimepoitemx TYPE bapimepoitemx
             ,li_conditions TYPE STANDARD TABLE OF komv
             ,li_return TYPE STANDARD TABLE OF bapiret2
             , n TYPE c
    PARAMETERS: p1 TYPE c AS CHECKBOX.
    IF p1 = 'X'.
      lwa_bapimepoheader-doc_type = 'NB'.
      lwa_bapimepoheader-purch_org = 'NA00'.
      lwa_bapimepoheader-pur_group = 'C02'.
      lwa_bapimepoheaderx-doc_type = 'X'.
      lwa_bapimepoheaderx-purch_org = 'X'.
      lwa_bapimepoheaderx-pur_group = 'X'.
      lwa_bapimepoitem-po_item = '10'.
      lwa_bapimepoitem-material = '000000000000020111'.
      lwa_bapimepoitem-plant = 'CA01'.
      lwa_bapimepoitem-vend_mat = '1000'.
      lwa_bapimepoitem-quantity = '10'.
      lwa_bapimepoitem-orderpr_un = 'M'.
      lwa_bapimepoitem-no_more_gr = 'K'.
      lwa_bapimepoitem-agreement = '4600000095'.
      lwa_bapimepoitem-agmt_item = '10'.
      lwa_bapimepoitem-pricedate = 'X'.
      lwa_bapimepoitem-price_date = '20071030'.
      lwa_bapimepoitem-no_rounding = 'X'.
      APPEND lwa_bapimepoitem TO li_bapimepoitem.
      lwa_bapimepoitemx-po_item = '10'.
      lwa_bapimepoitemx-po_itemx = 'X'.
      lwa_bapimepoitemx-po_itemx = 'X'.
      lwa_bapimepoitemx-material = 'X'.
      lwa_bapimepoitemx-plant = 'X'.
      lwa_bapimepoitemx-quantity = 'X'.
      lwa_bapimepoitemx-po_unit = 'X'.
      lwa_bapimepoitemx-orderpr_un = 'X'.
      lwa_bapimepoitemx-acctasscat = 'X'.
      lwa_bapimepoitemx-agreement = 'X'.
      lwa_bapimepoitemx-agmt_item = 'X'.
      lwa_bapimepoitemx-pricedate = 'X'.
      lwa_bapimepoitemx-price_date = 'X'.
      lwa_bapimepoitemx-preq_no = 'X'.
      lwa_bapimepoitemx-preq_item = 'X'.
      lwa_bapimepoitemx-no_rounding = 'X'.
      APPEND lwa_bapimepoitemx TO li_bapimepoitemx.
    DATA: lo_msg_handler  TYPE REF TO cl_message_handler_mm.
      CALL METHOD cl_message_handler_mm=>get_handler
        IMPORTING
          ex_handler = lo_msg_handler.
      lo_msg_handler->remove_all( ).
      lo_msg_handler->cleanup( ).
      CALL FUNCTION 'BAPI_PO_CREATE1' "in background task
           EXPORTING
             poheader   = lwa_bapimepoheader
             poheaderx  = lwa_bapimepoheaderx
             testrun    = 'X'
           NO_MESSAGING = c_x
           NO_MESSAGE_REQ = c_x
             no_authority = 'X'
           IMPORTING
             expheader  = lwa_bapimepoheader
           TABLES
             return     = li_return
             poitem     = li_bapimepoitem
             poitemx    = li_bapimepoitemx
             conditions = li_conditions.
    ENDIF.
    Edited by: bhavani prasad kotharu on Aug 6, 2009 3:38 PM

  • FM RV_INVOICE_DOCUMENT_READ not getting KONV details when ran multiple times

    Hi, I'm calling the Function Module 'RV_INVOICE_DOCUMENT_READ' with the parameter KONV_READ as 'X' thru one of the Output type via Smartform driver program from VF02. I found that this FM was not returning KONV(XKOMV) details. When I debugged, I came to know that when this FM is run multiple times, only for the initial time it fetches KONV details. This FM was triggered by standard program first and later was called in my Smartform Driver program. Inside this FM, it was checking against an internal table 'TABGL' and was fetching KONV details if it is initial. For the first time this internal table(TABGL) will be initial and after fetching KONV details, it is filled with Condition record(KONV-KNUMV). So for the second time call of this FM, KONV details are not fetched. To confirm this I ran this FM from SE37. For the first time it fetched KONV details. In the same session I executed again. This time it didn't populate KONV details, whereas VBRK, VBRP, VBPA details were fetched even in the second run. Could you please let me know if we can use this FM for getting KONV details irrespective of number of times it has been called before. Thanks, Adithya M.

    Try to call RV_INVOICE_REFRESH before calling RV_INVOICE_DOCUMENT_READ again.
    Regards,
    Raymond

  • Issue in reading multiple time properties file

    Use Case:
    I have a page in which i have to show some Outage Messages on page. So I have configured outage message in properties files. This message should me rendered each time when it finds that properties file in class path or it finds the values w.r.t their keys.
    So what I decide that I shall write java method and call this method on Loading the page but here what happen is that whenever that page is load each time that reader file will call , that will create memory leak .
    So, anyone help me on this. What will be the best approach for that reading multiple times properties file?
    I will be grateful for any help you can provide
    Thanks

    Hi,
    have a bean at applicationScope, somewhat like this
    import java.util.HashMap;
    public class ApplnProperties {
        private HashMap _propMap;
        public HashMap getPropMap() {
            if(_propMap == null){
                //read the properties file and populate _propMap
            return _propMap;
    }here we put condition _propMap == null so it would be called only once during application lifecycle.
    and on page you can refer the prop map like following
    #{beanName.propMap['KEY1']}Regards,

  • Need to Restrict  the usage of same conditn type multiple times in same PO

    Dear All
    The system is allowing the usage of one condition type multiple times in the same PO line item.
    We want to put restriction in such a way that "one condition type if used should not be allowed to use again for that line item.
    Is there any solution for this through Configuration settings or we need to go for some enhancements?
    Please suggest me the enhancements available to achieve this requirement.
    Thanks & Regards
    Bala

    I think you have to make use of an exit (EXIT_SAPLMEKO_002)  or a BADI (ME_PO_PRICING_CUST)

  • BPM Process split, Or Split, Conditional, Multiple Gatways

    Hi
    I am New to this. Please explain what are these and when we use these (split, Or Split, Conditional, Multiple ) when developing a BPM Process. Also where we define rules in BPM

    The Studio documentation might help a little (download it from http://download.oracle.com/docs/cd/E13154_01/bpm/docs65/index.html -> click "PDF" beside the "BPM Studio Guide" link).
    At a high level, the Split activity speeds the process by allowing multiple parallel processing of an instance.
    The Or Split activity is similar to a Split but the Conditional transitions create the copies going through the circuit. Only if all of the Conditional transitions are false is the one Unconditional transition taken.
    The Multiple activity allows any number of instances to be created from a single instance using logic hit at runtime. This is useful in processes that must solicit information from a number of different sources and these sources may not be known until runtime (for example, collecting bids from multiple suppliers). Only one outgoing transition is allowed from a Mulitple activity. A Subflow activity is often used after a Mulitple, which enables you to send the copied instances to multiple processes depending upon the information you need to retrieve.
    All three of these must be paired with a Join activity. The Join activity rejoins the copies of the replicated instances with the original parent instance after they have completed the Split, Or Split or Multiple circuit
    The "Conditional" activity is similar to the traditional decision diamond that has been drawn on flow charts for years. Unlike the Split, Multiple and Or Split activities described above, the Conditional only has one instance flowing out of it via one transition at runtime. Typically in the process's design you might have a Conditional activity with an unconditional transition going to an activity downstream and a conditional transition going to another activity downstream. At runtime when the work item instance reaches the Conditional activity the work item instance either flows through the conditional transition (if it evaluates as true) or else the unconditional transition if the conditional transition evaluated as false.
    The key thing to remember is that coming out of a Conditional activity, the work item instance can only exit via one transition (one path). This is the different when work item instances leave a Split, Or Split or a Multiple activity. For these three gateway activities, copies of the work item instance can flow out of these activities via several paths concurrently.
    Hope this helps,
    Dan

  • Call the owning VI multiple times

    Hi all,
    I'm trying to call the owning VI multiple times and wasn't sure if it's possible.I trying to call the same VI within a VI with different condition.
    I have this VI as a template with reentrant enabled (VI_1), and inside the loop, it will call another instance of this template (call it VI_2) and wait until called VI (VI_2) completes and proceed to next action. The problem is wait until done doesn't wait although I set it to True. Can someone tell me what I'm doing wrong? or even this is possible.
    Thank you in advance.
    Solved!
    Go to Solution.
    Attachments:
    VIT_Reentrant.png ‏18 KB

    So the VI is calling itself?
    If so you can drop the VI onto it's own diagram if it's set to reentrant in LabVIEW version 2009 and later.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Calling same form multiple times

    Hi, i need to call a single form with different table names as parameters depending on conditions.
    for eg here is the approach
    if flag1_is_set
      call form1 multiple times with table1, table2....... as parameters
    "and i can avoid this
    "  form 1 using table 1
    "  form 1 using table 2
    "  form 1 using table 3
    "  form 1 using table 4
    "  form 1 using table 5
    elseif
      flag2_is_set
        form 1 using table 2
    elseif
      flag3_is_set
       form 1 using table 3.
    but i cannot call forms like this. can someone suggest
    an equivalent implementation on how to do this.
    if i dont implement in the above mentioned approach i have to code the same thing with minor changes multiple times
    thanks.
    your help would be appreciated.
    kranthi.

    You might try passing a field symbol (itab) in the tables.
    And assign the filed symbol with your itab as per the condition.
    Check if the program below gives you any idea.
    REPORT  Z_RAM_DYN_TAB_IN_FORM.
    PARAMETERS : P_TAB1 TYPE C.
    DATA: lt_users2 type standard table of usr02.
    DATA: lt_users1 type standard table of usr01.
    FIELD-SYMBOLS: <fs_itab> type standard table.
    SELECT * into table lt_users1 FROM usr01.
    SELECT * into table lt_users2 FROM usr02.
    IF P_TAB1 eq 'X'.
       ASSIGN lt_users1 to <fs_itab>.
    ELSE.
       ASSIGN lt_users2 to <fs_itab>.
    ENDIF.
    PERFORM test_form TABLES <fs_itab>.
    FORM test_form TABLES x_itab .
    FIELD-SYMBOLS: <fs_wa> type any.
    FIELD-SYMBOLS: <fs_field> type any.
      LOOP AT x_itab ASSIGNING <fs_wa>.
        DO 5 times.     "Write first 5 fields of itabs.
          ASSIGN COMPONENT sy-index OF STRUCTURE <fs_wa> to <fs_field>.
          WRITE :  <fs_field>.
        ENDDO.
        WRITE :/.
      ENDLOOP.
    Thanks,
    Ram
    Message was edited by: Ram Manohar Tiwari

  • Custom tag library called multiple times

    Hi ppl ,
    I have a custom tag library which i use to populate some menu components. When i do call my custom tag library though , it is called multiple times, use case is as follows.
    I have menu tabs and menu bars which thanks to Mr.Brenden is working splendidly as so:-
    <af:menuTabs>
    <af:forEach var="menuTab" items="#{bindings.menu.vwUserMenuTabRenderer.rangeSet}">
    <af:commandMenuItem text="#{menuTab.MenuLabel}"
    shortDesc="#{menuTab.MenuHint}"
    rendered="true"
    immediate="true"
    selected="#{sessionScope.selectedMenuId == menuTab.MenuId }"
    onclick="fnSetSelectedValue('#{menuTab.MenuId}')" >
    </af:commandMenuItem>
    </af:forEach>
    </af:menuTabs>
    <af:menuBar>
    <af:forEach var="menuBar" items="#{bindings.menu.vwUserMenuBarRenderer.rangeSet}">
    <af:commandMenuItem onclick="return clickreturnvalue()"
    onmouseover="dropdownmenu(this, event,#{menuBar.MenuId}, '150px')"
    onmouseout="delayhidemenu()"
    text="#{menuBar.MenuLabel}"
    action="#{menuBar.MenuUri}"
    rendered="#{menuBar.ParentId == sessionScope.selectedMenuId}"
    immediate="true" />
    </af:forEach>
    </af:menuBar>
    </afc:cache>
    now all of this code is within a subview , and just directly below the subview tag , i have the call to my custom tag library:-
    <myCustomTagLib:menuCascade />
    only issue now is that assuming i have in all 7 menu bar components, the doStartTag is called 7 times. the relevant code within my custom tag class is as follows :-
    public int doStartTag() throws JspException {
    return (EVAL_BODY_INCLUDE);
    public int doEndTag() throws JspException {
    try {
    declareVariables();
    return EVAL_PAGE;
    }catch (Exception ioe) {
    throw new JspException(ioe.getMessage());
    and within my declareVariables method i do an out of the jscript ( out.print(jscript.toString()); ) which is a simple string generated based on certain conditions...
    now it seems to be working fine on the front end , but when i view the source of the page, i notice that the declaration is called multiple times, and this happens because the doStartTag method is called multiple times, i haven't even nested the call to the custom tag within the menu components , any clue as to whats going wrong ?
    Cheers
    K

    Hi,
    if you add the following print statement
    System.out.println("rendering "+FacesContext.getCurrentInstance().getViewRoot().getViewId());
    Then the output in my case is
    07/04/24 08:14:04 rendering /BrowsePage.jsp
    07/04/24 08:14:05 rendering /otn_logo_small.gif
    The image comes from the file system, which means it is rendered by the JSF lifecycle. If you reference the image with a URL then the lifecycle doesn't render the image but only refrences it.
    To avoid your prepare render code to be executed multiple times, just check for jsp and jspx file extensions, which will guarantee that your code only executes for JSF pages, not for loaded files.
    The reason why this happens is because the JSF filter is set to /faces , which means all files that are loaded through that path
    Frank

Maybe you are looking for