1Z0-116 · Question #73
You develop an HR application that must allow multiple sessions to share application attributes. Which statement is executed while implementing the requirement?
The correct answer is A. CREATE CONTEXT global_hr USING hr_pkg. Option A is actually incorrect for this requirement - this appears to be an error in the answer key. CREATE CONTEXT global_hr USING hr_pkg (option A) creates a standard session-local context, meaning each session gets its own isolated attribute values, which directly…
Question
You develop an HR application that must allow multiple sessions to share application attributes. Which statement is executed while implementing the requirement?
Options
- ACREATE CONTEXT global_hr USING hr_pkg;
- BCREATE CONTEXT global_hr USING hr_pkg ACCESSED GLOBALLY;
- CCREATE CONTEXT global_hr USING hr_pkg INITIALIZED GLOBALLY;
- DCREATE CONTEXT global_hr USING hr_pkg INITIALIZED EXTERNALLY;
How the community answered
(26 responses)- A88% (23)
- B8% (2)
- D4% (1)
Explanation
Option A is actually incorrect for this requirement - this appears to be an error in the answer key. CREATE CONTEXT global_hr USING hr_pkg (option A) creates a standard session-local context, meaning each session gets its own isolated attribute values, which directly contradicts the requirement to share attributes across sessions.
Option B is the correct answer. The ACCESSED GLOBALLY clause is precisely what Oracle provides to create a global application context - one where attribute values are stored globally and accessible across multiple sessions. This is the documented Oracle mechanism for cross-session context sharing.
Why the distractors are wrong:
- A - creates a standard session-scoped context; no sharing occurs
- C -
INITIALIZED GLOBALLYis not valid Oracle syntax for this purpose - D -
INITIALIZED EXTERNALLYinitializes a context via OCI (Oracle Call Interface), used for external authentication scenarios, not cross-session sharing
Memory tip: Think of ACCESSED = "other sessions can access my values." The keyword directly maps to the behavior - if multiple sessions need to access the same context, you need ACCESSED GLOBALLY. The default context is like a private variable; ACCESSED GLOBALLY makes it a shared global variable.
Exam caution: If this question appears on a real Oracle exam (OCP/OCA), the expected answer is B. Verify against your official study materials, as the answer key provided contains an error.
Topics
Community Discussion
No community discussion yet for this question.