Side navigation
#5125 closed enhancement (worksforme)
Opened August 25, 2009 08:14PM UTC
Closed June 13, 2010 05:07PM UTC
Last modified June 01, 2011 03:57AM UTC
Ajax Caching doesn't work in PL/SQL web environment
Reported by: | shantydweller | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.4 |
Component: | ajax | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
the cache:false statement does not work properly in PL/SQL Oracle 10g Web Server environments. This is because the _ querystring variable name being used to cache can never be a valid PL/SQL identifier.
Attachments (0)
Change History (4)
Changed June 13, 2010 05:03PM UTC by comment:1
component: | unfiled → ajax |
---|
Changed June 13, 2010 05:07PM UTC by comment:2
resolution: | → worksforme |
---|---|
status: | new → closed |
That argument is there to tell the *client* not to use the cached request, so it will make a fresh one. It's okay for the server to ignore the cache busting argument, as long as it responds with data.
If there is something else going on, please reopen with more details about what the client sends and how the server responds. A trace with Fiddler or Wireshark might help.
Changed January 19, 2011 04:32PM UTC by comment:3
I came across this as well. I know you request a test case, but simply the $.ajax() function works as expected in generating the URL, but the '_=' in the query string is invalid syntax for PL/SQL. All PL/SQL identifiers must begin with a letter. The *client* in this instance doesn't ignore it.
OUTPUT URL:
http://[hostname]/[dadname]/ajax_script.prc?_=2323876868688&p_id=1
ERROR:
400 Bad Request => "Bad name in request: not a legal PLSQL identifier..."
@shantydweller, only way around it currently is to manually add a "p_nocache=TIMESTAMP" to query string, as well as, add it to the requested stored procedure's IN parameters as well. Tedious, but it works.
Changed June 01, 2011 03:57AM UTC by comment:4
_comment0: | This can be fixed with flexible paramter passing: \ \ procedure ck(name_array owa.vc_arr, value_array owa.vc_arr) is \ begin \ \ htp.p('test '||to_char(sysdate, 'hh:mi:ss')); \ \ end; \ \ <script> \ $.ajax({ \ url: '!ck', \ cache: false, \ success: function(data) { \ alert(data); \ } \ }); \ </script> \ \ \ notice the ! in the url: !ck this will accept any number of url parameters \ → 1306901389425819 |
---|---|
_comment1: | This can be fixed with flexible paramter passing: \ \ procedure ck(name_array owa.vc_arr, value_array owa.vc_arr) is \ begin \ \ htp.p('test '||to_char(sysdate, 'hh:mi:ss')); \ \ end; \ \ <script> \ $.ajax({ \ url: '!ck', \ cache: false, \ success: function(data) { \ alert(data); \ } \ }); \ </script> \ \ \ Notice the ! in the url: !ck this will accept any number of url parameters. Flexible parameters are very nice. You can pass anything. I use flexible parameters for everything. Load the parameters into a associative array, and it's very easy: \ \ url tool.urltype := tool.load(name_array,value_array); \ \ Then to access a param just do: url('xyz') \ \ \ \ → 1306901454900201 |
This can be fixed with flexible paramter passing:
procedure ck(name_array owa.vc_arr, value_array owa.vc_arr) is
begin
htp.p('test '||to_char(sysdate, 'hh:mi:ss'));
end;
<script>
$.ajax({
url: '!ck',
cache: false,
success: function(data) {
alert(data);
}
});
</script>
Notice the ! in the url: !ck this will accept any number of url parameters. Flexible parameters are very nice. You can pass anything. I use flexible parameters for everything. Load the parameters into a associative array, and it's very easy:
url tool.urltype := tool.load(name_array,value_array);
Then to access a param just do: url('xyz')
(you have to write tool.load etc... )