APEX 4.1 APEX_UTIL.CLEAR_PAGE_CACHE Bug

Hi,
I found the following issue in APEX 4.1. It's easiest described with an example:
Before going into a page process suppose P1_X = 'abc' in session state;
-- First page process (coming in P1_X = 'abc')
l_backup := :P1_X;
apex_util.clear_page_cache(:app_page_id);
:P1_X := l_backup;
-- Second page process (following the page process above)
-- This prints the value of P1_X to the screen
sys.htp.p(':P1_X: ' || nvl(:P1_X, 'null'));
-- Results:
-- APEX 4.0: (expected value)
:P1_X: abc
-- APEX 4.1 (incorrect)
:P1_X: nullIf I change +:P1_X := l_backup;+ line to apex_util.set_session_state('P1_X', l_backup); the output is:
-- Results (correct):
-- APEX 4.0:
:P1_X: abc
-- APEX 4.1
:P1_X: abcIf I change the +:P1_X := l_backup;+ line to +:P1_X := 'def';+ the output is:
-- Results (correct):
-- APEX 4.0:
:P1_X: def
-- APEX 4.1
:P1_X: defIt appears in 4.1 that any time a page item is set following a clear cache call (this issue also happens for clear_app_cache) and the page item value is the same as it was before the clear cache value (using a bind variable set) then its value is null in session state once the page process completes.
This was found in APEX version 4.1.1.00.23 and compared against 4.0.2.00.09
Martin
http://www.ClariFit.com
http://www.TalkApex.com
Edited by: Martin Giffy D'Souza on Oct 5, 2012 3:36 PM

Hi Martin,
thanks for reporting this. This change was introduced during a code reorg in 4.1.
The reason for the current behaviour is our dynamic code exec implementation:
1. create cursor and parse as user
2. for all bind variables:
3.      save session state value in local variable array
4.      bind local value in cursor
5. execute cursor
6. for all bind variables:
7.     if current bind value is different to local variable array value:
8.         save current value in session state Step 7 only detects a change if the bind variable value itself has been modified in the dynamic pl/sql block. I filed bug #14731783 to fix this, but we will probably ship it with the first patch set.
As a work-around, you should be able to use
l_backup := :P1_X;
apex_util.clear_page_cache(:app_page_id);
apex_util.set_session_state('P1_X', l_backup);
which does not rely on the dynamic code exec for writing back the original value of P1_X.
Regards,
Christian

Similar Messages

  • APEX Documentation Bug: APEX_UTIL.CLEAR_PAGE_CACHE

    For APEX Team (documentation)..
    APEX_UTIL.CLEAR_PAGE_CACHE says the parameter is p_page when it should be p_page_id.
    Martin

    Martin - Thanks.
    Scott

  • Apex 3.2 Spell Check Bug?

    I have a text area with spell check that holds 4000 characters. The spell check works well until approx 3800 characters are entered into the field. At that point in time the spell check brings up a page can't be displayed popup. Ideas?

    blarman,
    I was going to ask you to reproduce this on apex.oracle.com, but of course, you cannot. The images directory on apex.oracle.com has been recursively copied into numerous times. The problem you're reporting is only in the context of a new installation.
    I've confirmed the bug. It's too late for the forthcoming APEX 3.2.1 patch set, but I do have this now fixed for APEX 4.0.
    Thanks for taking the time to report this issue. I appreciate it.
    Joel

  • Apex 4 JavaScript API documentation bug

    Hi,
    JavaScript API documentation have exactly same description for functions
    $f_Hide_On_Value_Item
    $f_Show_On_Value_Item
    >
    Checks an page item's (pThis) value against a value (pValue). If it matches, a DOM node (pThat) is set to hidden. If it does not match, then the DOM node (pThat) is set to visible.
    >
    And also functions have same description
    $f_Hide_On_Value_Item_Row
    $f_Show_On_Value_Item_Row
    >
    Checks the value (pValue) of an item (pThis). If it matches, this function hides the table row that holds (pThat). If it does not match, then the table row is shown.
    >
    I think that is not correct
    http://download.oracle.com/docs/cd/E17556_01/doc/apirefs.40/e15519/javascript_api.htm#CHDHIAJB
    Somehow I recall there has been post about this, but I can not find it.
    Regards,
    Jari

    The description of these functions have been corrected. The latest updated version of this document is now available on the Oracle Technical Network (OTN).
    Thanks for reporting the bug,
    Drue Swadener
    Principal Technical Writer

  • APEX 4 - apex_util.get_blob_file 404

    Hi
    I'm getting the following error after upgrading to APEX 4.0
    apex_util.get_blob_file HTTP-404 ORA-20544: Invalid table owner\nORA-06512: at "APEX_040000.WWV_FLOW_DML", line 1628\nORA-06512: at "APEX_040000.HTMLDB_UTIL", line 2226\nORA-06512: at line 22This is generated by the following PLSQL call
    apex_util.get_blob_file_src('P5_CUSTOMER_LOGO',cust_id)The underlying view is owned by another schema but it has granted select,insert,update,delete access to the application parsing schema. This was working Ok in 3.2.
    Any help would be appreciated....
    Cheers
    Matt

    Hi Matt,
    I looked at the offending line which is raising this exception. A check was added in APEX 4.0 to determine if the table owner was different than the parsing schema, and if it was different, then verify if the table owner is mapped as a schema to the workspace.
    Here's the kicker, though - I'm not convinced that this check needs to be this restrictive. I'll review this with the developer who made this change and reply back to this thread.
    Joel

  • Physically printing a report from Apex using BI Publisher

    Hi,
    I know it is possible to generate and download a PDF (or any other format) in Apex using BI Publisher (Apex 4.0.2)
    But is it possible to physically PRINT a report in a specified printer? For example, the user clicks a button and the report comes out of the printer just like that.
    Note: I am NOT after a solution where the report is firstly displayed on the screen and then the user performs some action to print it from there (that is pretty easy to do.)
    I know that BI Publisher can do it, as its web service has an option to do so.
    Thanks
    Luis

    Hi Luis,
    not sure this is possible.
    Only SOME of the features of BI Publisher are used from APEX as a service to create the reports.
    *) I am not aware of any parameters / attributes in APEX so that you could specify a printer directly
    *) It is not part of the API you could use instead manually:
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_util.htm#CHDGFADB
    I have just recently implemented that myself for an integration with JasperReports. It is currently in beta test:
    http://daust.blogspot.de/2012/08/jasperreportsintegration-200-beta-test.html
    Thus your options are:
    *) I am not sure that BI publisher allows that but perhaps you could first call the apex utility function apex_util.get_print_document to retrieve the blob from bi publisher. Then perhaps (if allowed) send the blob again by yourself and using the print features of bi publisher.
    Here you would have to write the utl_http communication yourself.
    *) If bi publisher doesn't allow the separate process (generation first and then sending it to a printer) then you would also have to write a j2ee application which does that.
    *) another option could be to store the generated blob in the filesystem on the database and call a shell script from within the database. This shell script would send it to the network printer.
    Hope that helps,
    ~Dietmar.

  • Where are these api's stored in the database for apex?

    I don't know if my version of APEX has the apex_util.edit_user API. Can You tell me how I can find it?

    Forgive me if I'm reading this wrong here, but I suspect that you have the validation the wrong way round.
    Firstly, I am assuming that when you say "validation" you mean the in-built apex validation items, rather than some custom process. If so, validation messages are only triggered upon failure i.e. if you want the validation to check that passwords are exactly 8 characters long, the validation should be: length(:P90_PASSWORD) = 8 This means that passwords which are 0-7 or >8 characters in length will fail the validation and thus trigger the validation failure message.
    Remember: the purpose of apex validation is to confirm validity - not find invalidity - and thus should be written accordingly. It's a subtle distinction but important!

  • BUG? "ERR-1002 Unable to find item ID..." on branch on upgrading 3.0 to 4.0

    I'm testing the waters prior to upgrading a customer application from APEX 3.0.0.00.20 to 4.0.2.00.07.
    The application has been exported from the APEX 3.0 environment on a 4.0 instance on a different server. Both databases are 10.2.0.4.0 EE.
    A on navigating—via a standard tab—to a page containing only conditional On Load: Before Header branches, the branches are failing with
    Unexpected error, unable to find item name at application or page level.
    Error: ERR-1002 Unable to find item ID for item "p810_status" in application "121". This is caused by the branch action having Set these items item names specified in lower case:
    p810_status,p810_read_onlyThe error is resolved by changing these item names to UPPER CASE.
    This is not a disaster. Using APEX views I can see that there are only a handful of branches specifying item names in lower case so it won't require major effort to fix this app when it's upgraded for real.
    However, (a) I am aware that there are other places in this app where item names are specified in lower case; and (b) I tend to type most of my development stuff in lower case, so I'd like clarification on this issue.
    <li>Is this a known issue? (Can't find any earlier mention of this on OTN, MOS or web)
    <li>Is this expected behaviour in APEX 4.x or a bug?
    <li>If a bug is it fixed in 4.1?
    <li>Is there a change in APEX 4.0 requiring branch item (and other?) references to be uppercase? If so, where is this documented?
    I notice that it works OK when the same item values are specified in the URL using lowercase item names.
    Bumped by: fac586 on 08-Mar-2012 15:51
    I noticed that APEX 4.0.2 has converted all branches to use the [now] late, lamented "Set value before branching" option. Is this significant? Obviously this won't occur if upgrading to 4.1.
    Edited by: fac586 on 12-Mar-2012 15:14

    Hi Lukx,
    Thank you for reporting this. You have hit upon an issue with this page, for which I have filed Oracle bug #11840642. To get around this in the meantime, you can see page specific changes by going to:
    1) The 'Page Definition' page for the page you want to see recent edits.
    2) Go to 'Utilities > History'. This will show you recent actions for components on the current page.
    Hope that helps and thanks again for catching this.
    Regards,
    Anthony.

  • BUGS: Theme 17 Tabs

    I've come across a couple of problems with theme 17 (Greyscale).
    I started investigating a rendering problem with theme 17 tabs in Webkit-based browsers.
    I haven't yet figured out why Webkit is computing the height of the tab &lt;div&gt;s differently to other browsers. Obviously happy to hear from anyone who's figured this out.
    However the 2-level tab page template contains an HTML error in that the wrapper &lt;div&gt;s for the parent and child tabs are both assigned the id attribute value "t17Tabs", when ids must be unique within a document:
    &lt;div id="t17Tabs"&gt;#PARENT_TAB_CELLS#&lt;/div&gt;&lt;div id="t17Tabs"&gt;#TAB_CELLS#&lt;/div&gt;Themes normally use another "t17ChildTabs" or suchlike ids with 2-level tabs, but as well as being missing from the page template, there is no such selector referenced in the theme 17 CSS. This leads me to think that identical treatment of both tab levels is intended, and "t17Tabs" should be a class attribute not an id?
    Edited by: fac586 on 04-Sep-2011 10:42
    Removed link to example application as it is no longer relevant.

    Finally found some time to look at this again.
    1. The Webkit browser problem is due to the following CSS rule:
    .t17CurrentTab, .t17Tab { display: -moz-inline-box; }which is in the main /theme_17/theme_3_1.css CSS file, and of course is only recognised by Mozilla browsers. The following rule is in the IE-only /theme_17/ie.css CSS file hidden from other browsers in a conditional comment so is only applied to IE.:
    .t17CurrentTab { display: inline-block; }
    .t17Tab { display: inline-block; }So the fix to display tabs properly in Safari and Chrome (and Opera for that matter) is to change the rule in theme_17/theme_3_1.css (or elsewhere) to:
    .t17CurrentTab, .t17Tab {
      display: -moz-inline-box;
      display: inline-block;
    }which works with all browsers as FF 3+ now also supports inline-block (and the original property still works in FF2). This also actually makes the IE-only CSS superfluous at the present time as the above are the only rules in it.
    2. The duplicate t17Tabs ID issue obviously remains, so I've changed my local templates to have class="t17Tabs" instead and supplied the required CSS:
    .t17Tabs {
      border-bottom: 1px solid #000;
      text-align: left;
      white-space:nowrap;
    }Edited by: fac586 on 04-Sep-2011 10:43
    This was fixed as bug 8527710 in the APEX 3.2.1 patch set. However, this theme 17 "Greyscale" as replaced by a completely different theme 17 "Sapphire" in APEX 4.0, rendering this bug (and workaround) of historical interest only.

  • ApEx 3.1 HDTML javascript issue

    I very much appreciate the new enhancements in the ApEx 3.1 -- especially the interactive reports. I'm running into a problem however when attempting to customize it a bit. I won't give you the entire history, unless you really want it, but the skinny of it is that I am wondering if I can request a development change be made to the apex_3_1.js file for the next sub-release of ApEx.
    I am issuing a DOCTYPE tag at the top of pages via the header section of a page template. This DOCTYPE is to help make some of our custom css work. When we implemented this in our development workspace however, we found that it broke the dHTML list types and the dHTML Action Menu of the interactive reports.
    After some snooping around, we believe that a change to the way the apex_3_1.js file displays dynamic menus would help not only our situation, but also help the general community. I'm very open to hearing reasons for not making this change.
    We found the javascript function dhtml_MenuOpen within the apex_3_1.js file is setting the position of the menu to be absolute and then setting the top and left attributes to a number. We wonder if the assignment of the top and left attributes should append the letters "px" to that assignment so that the browser knows explicitly that the value is in pixels.
    Does this sound legitimate and feasible? Is there a strong reason not to do this? If you'd like more details of what I'm talking about and why, feel free to ask. I'm not an HTML expert or anything, but I'm just relaying what a web guy at our place is suggesting. He mentioned that there are several instances in this javascript file where adding "px" to a value where "top", "left", etc. are being set would be appropriate.
    I don't know if or how to suggest this to the ApEx development team as a bug or what, but I've seen other posts here where people have asked what to do and suggested that simply stating the issue here would not only allow others to comment on it, but the development team would see it too.
    Shane.

    Hello Shane,
    In principle, I’m all for revising these functions, to not use absolute positioning, and make them BiDi oriented. However, that probably will not happen soon.
    In your case, I don’t think adding ‘px’ can break functionality. You can add your request into the post 3.1 enhancement list in here - Enhancement Request Thread : Post 3.1 .
    Until then, you can try to find a workaround. As far as I can tell, the dhtml_MenuOpen() is being called through the template you are using for your menu. You can duplicate this template, change the JS function (e.g. dhtml_MenuOpen1() ) and in the new function add everything you think will help your application.
    Although changing the original JS file is also an option, it’s not advisable, because it can turn your system to an unsupported one. In any case, remember that the apex_3_1.js file is a compressed one, so you’ll have to be extra careful.
    Regards,
    Arie.

  • Display A Success Message From An Application Process

    Apex 3.2
    I have an on demand application process, which is resetting my application, except application items
    BEGIN
       FOR c IN (SELECT page_id
                   FROM apex_application_pages
                  WHERE application_id = :app_id)
       LOOP
          apex_util.clear_page_cache (c.page_id);
       END LOOP;
    :F270_REFRESH_INTERVAL := null;
    END;
    I have a list item that calls some javascript on page zero
    <script type="text/javascript">
    function resetapp(){
    var answer=confirm("Do you really want to reset the application ?");
    if(answer==true) {
    var get = new htmldb_Get(null, null, 'APPLICATION_PROCESS=RESET_APPLICATION');
    var gReturn = get.get();
    redirect('f?p=&APP_ID.:1:&APP_SESSION.');
    </script>
    The user clicks on the item in the list. A confirmation appear and when they click ok,
    then the on demand process runs and they are directed to page 1.
    This is all working ok.
    My problem is that I would like to display a message (a sucesss message) on page 1.
    I have an unconditional branch on page 1 with the tick box checked for include process message.
    I have tried the following in my application process, but none seem to work.
    apex_application.g_print_success_message := 'Application Has Been Reset';
    htp.prn('Application Has Been Reset');
    HTP.P('Application Has Been Reset');
    How can I do this ?
    Gus

    Can anyone help ?
    Gus

  • Saving Preferences

    Hello,
    I have a list of employee names and when the user selects from this list, the user has the option to apply or apply and save the preferences of the employees selected. If the user clicks apply and save, logs off, and logs back in, the preferences selected from the employee list are selected and displayed...That works GREAT!
    The problem is when the user clicks apply and goes to another page (without logging off) and comes back to the page, the employees that were selected from the list are still selected and displayed. But when logging off and logging back in, the employee names that were select when the last time the user clicked apply and save are displayed.
    Is there a script or something that when the user goes to another page and comes back, displays the preferences that were saved? I noticed that APEX saves all the changes until the user logs off, is there a way for APEX not to save the preferences in some pages, when still logged in?
    Thanks,
    Bino

    I tried putting this in a process (on load after footer):
    BEGIN
    APEX_UTIL.CLEAR_PAGE_CACHE('4');
    END;
    it clears it when I go to another page and come back. But now when i hit apply and save it applies the changes but when logging off and logging in it doesn't show the employees that i selected previously. It shows the one that i selected before putting the APEX_UTIL.CLEAR_PAGE_CACHE('4'). Am I putting this in the weong place?
    i'm using APEX_UTIL.GET_PREFERENCE and APEX_UTIL.SET_PREFERENCE to save the preference.
    Thank you,
    Bino

  • Special Characters not showing using Report Query

    I run my BI pub reports from APEX page using apex_util.download_print_document (see below).
    It looks like it is stripping out the '+' from the report when displaying. It shows correctly inthe XML file.
    I even tried encoding with SELECT max(replace(I1.alpha_grade,'+','%2B')) . This prints the '%2B' instead of the '+'.
    Any ideas?
    apex_util.download_print_document(
    p_file_name => l_form_description,
    p_content_disposition => 'attachment',
    p_application_id => v('APP_ID'),
    p_report_query_name => nvl(l_report_query_name,l_form),
    p_report_layout => l_layout,
    p_report_layout_type => 'rtf',
    p_document_format => v('P507_OUTPUT_FORMAT'));

    Glad it worked out for you Bob; here is the site I used for HTML to Character conversion chart.
    [url http://www.ascii.cl/htmlcodes.htm]HTML Codes - Characters and symbols
    Jeff

  • Clear cache of 2nd level tabs

    Hello,
    I have a question related to clearing the cache in a two level tab application structure. If you look at the examples application of Denes Kubicek, you see that he uses a two level tab structure. The horizontal bar below the header is level 1 and the left 'menu-bar' is level 2.
    I've also tried to implement this, because I think it's a real nice way to offer a good navigation structure. But I haven't found a good way to clear the cache of a page that is opened when someone clicks on a 2nd tab-level. Anyone an idea? Maybe Denes himself can help me out?
    Thanks!
    Jacob

    I think you are referring to standard tabs as second-level and parent tabs as first-level. I always think of them the other way round. Okay, what you need to do is create an application process that fires (by default, for every page view) conditional on the request being the tab name (T_ORDERS, for example). The process firing point must be On Submit - Before Computations and Validations. In this process you can determine the page being submitted with the standard tab using :APP_PAGE_ID and the name of the tab submitting the page, again, using :REQUEST. Then the process can call apex_util.clear_page_cache to do the cache-clearing you need.
    Scott

  • Question - Resetting Interactive Reports on Different Pages

    Hi,
    I currently have 5 pages, each with an Interactive Report. Page 1 contains column links with filters to the other 4 pages.
    Once a user has clicked a column link with the relevant column filtered on the Interactive Report on the other page, the only way I can see for the user to reset each Interactive Report is to manually reset the report on each page.
    Is there any way to perform the "RIR" or "CIR" clear cache setting on all the Interactive reports for a delimited list of pages via one button click?
    Thanks in advance,
    - Stuart

    Hi Simon,
    The scenario could be that the user clicks on 3 different column links on page 1 and the Interactive Reports on those linked pages are filtered. The user is happy with the information and decides that he/she wants to look for completely different data within the Interactive Report on page 2 (3 or4).
    When they go to that page, it is still filtered based on the column link. To reset the report, they need to manually select Reset from IR menu. This would need to be done for each of the other pages with previously filtered reports.
    The Reset I am looking to perform is almost like when each page is visited. It would be similar to performing a clear page cache on multiple pages and you pass the page number as a parameter from one button click using a PL/SQL block. i.e.
    BEGIN
    APEX_UTIL.CLEAR_PAGE_CACHE('1');
    APEX_UTIL.CLEAR_PAGE_CACHE('2');
    APEX_UTIL.CLEAR_PAGE_CACHE('3');
    END
    Ideally, if there was some way to do something similar for all or specific Interactive reports then it would reduce the number of clicks made by the user.
    The application is to be aimed at users, who need to get information with as few clicks as possible.
    - Stuart

Maybe you are looking for

  • Can you transfer everything from your ipod to a new computer, not just itunes purchases

    Can you transfer all of your info from the ipod back to the computer?  My computer crashed and I cannot get to the back up to transfer to my new computer.  I have only been able to transfer itunes purchases.

  • How can I create a new Security Domain ?

    Hi everyone, I would like to know how can I create an Security Domain other than ISD ?(If my card support multi SD and delegated management) I read Global Platform v2.1.1 ,but I don't know how can I create new SD practically(how can I write it's code

  • Enabling Commenting Tools in embedded mode

    We have own plug-in which provides collaboration capabilities for reviewing documents introducing custom annotations with categorization based on standard Acrobat annotation feature. However Commenting tool is not available in post 6 Acrobat versions

  • System Resource Management

    I am trying to do display a graphic message something for a certain amount of time(eg:5 minutes). I do it this way int timediff = 0; Date d1 = new Date(); long timeSwitched = d1.getTime(); while(timediff!=5*60*1000) Date d2 = new Date(); long nowTime

  • Removing background from plastic wrap

    Hi all, I need to remove the background from this image while keeping the straw and plastic wrap. Have looked all over for a tutorial, but no luck. Any help on how to do this would be much appreciated! Thanks in advance,