What is the scope of the apex global variables APEX_APPLICATION.G_X01...G_X10? Are they truly 'global', session-scoped or request-scoped?
I did some tests and my findings seem to be that these global variables are request-scoped (ie: other requests in the same session and other requests in different sessions get their own copies of the global variables), but I'd like to confirm my findings are correct.
Details of our setup:
client-side JS code looks like this:
data = {'first_name':$('#P25_FIRST_NAME').val()};
data = JSON.stringify(data);
$.ajax({
type: "POST",
url: "wwv_flow.show",
data: {
p_flow_id:$('#pFlowId').val(),
p_flow_step_id:$('#pFlowStepId').val(),
p_instance:$('#pInstance').val(),
x01:data,
p_request:"APPLICATION_PROCESS=AJAX_TEST"
},
dataType: "json",
success: function(data) {
alert('success:\n' + data);
},
error: function(data) {
alert('error:\n' + data);
},
});
server-side PL/SQL code looks like this:
CREATE OR REPLACE PROCEDURE
AJAX_TEST IS
JSON_REQUEST JSON;
JSON_RESPONSE JSON;
BEGIN
JSON_REQUEST := JSON(APEX_APPLICATION.G_X01);
JSON_RESPONSE := JSON();
JSON_RESPONSE.PUT('first_name', JSON_REQUEST.GET('first_name').GET_STRING());
JSON_RESPONSE.PUT('last_name', 'smith');
HTP.P(JSON_RESPONSE.to_char());
END AJAX_TEST;
I want to be sure that the variables APEX_APPLICATION.G_X01, X02, etc...won't be affected by other requests within the scope of processing the current request.
Thanks much!