Oracle Database: Program with PL/SQL — Question 40
In which situation will cached results become invalid?
Answer options
- A. When the memory allocated to the server result cache is increased using the RESULT_CACHE_MAX_SIZE initialization parameter
- B. When a session executes an insert, update, or delete statement on a table or view that is queried by the result-cached function
- C. When a session on this database instance invokes the function with the same parameter values
- D. When the RESULT_CACHE_MODE parameter is set to FORCE.
- E. When a new session is opened to invoke the function which is already cached
Correct answer: C, D
Explanation
Cached results become invalid when the same parameter values are used to invoke the function again, as this could lead to outdated data being returned. Additionally, setting the RESULT_CACHE_MODE parameter to FORCE also invalidates cached results because it ensures that the function executes and fetches fresh data instead of relying on cached results. The other options do not cause cache invalidation directly.