2011-09-09 36 views
-4

圖像中關於全局變量的以下信息是否正確,如果沒有,請告訴我爲什麼。高速緩存中的全局變量狀態是否正確

Examine this code: 
CREATE OR REPLACE PACKAGE comm_package 
IS 
g_comm NUMBER := 10; 
PROCEDURE reset_comm(p_comm IN NUMBER); 
END comm_package; 
/
User Jones executes the following code at 9:01am: 
EXECUTE comm_package.g_comm := 15 
User Smith executes the following code at 9:05am: 
EXECUTE comm_package.g_comm := 20 

Which statement is True? 

A. g_comm has value of 15 at 9:06 for smith. 
B. g_comm has value of 15 at 9:06 for jones. 
C. g_comm has value of 20 at 9:06 for both smith and jones. 
D. g_comm has value of 15 at 9:03 for both smith and jones. 
E. g_comm has value of 10 at 9:06 for both smith and jones. 
F. g_comm has value of 10 at 9:03 for both smith and jones. 

ANSWER: B. 
+1

圖像不能被其他用戶索引/搜索,所以它只是'污染'問題數據庫。 –

+0

感謝ALOT爲了讓我意識到我的錯誤,下次我會照顧它。 – parmanand

回答

4

包變量狀態在會議水平的作用範圍。因此唯一可以看到G_COMM=15的用戶將是Jones。因此B是正確的答案。

+2

+1。如果您需要「跨會話」變量,請查看全局應用程序上下文 –