Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

When the server version is lower than 12, each query SQL will trigger the query of nls_session_param

User_8HVX1Jan 27 2022

When the server version is lower than 12, each query SQL will trigger the query of nls_session_parameters · Issue #231 · oracle/dotnet-db-samples (0 Bytes)Each query SQL will trigger an SQL

DECLARE err_code VARCHAR2(2000);  
	err_msg VARCHAR2(2000); BEGIN  
	SELECT VALUE into :p_nls_comp from nls_session_parameters where PARAMETER='NLS_COMP'; 
	SELECT VALUE into :p_nls_length_semantics from nls_session_parameters where PARAMETER='NLS_LENGTH_SEMANTICS'; 
	SELECT VALUE into :p_nls_nchar_conv_excep from nls_session_parameters where PARAMETER='NLS_NCHAR_CONV_EXCP'; 
	SELECT '0' into :p_err_code from dual;  
	SELECT '0' into :p_err_msg from dual;  
END;

Oracle server version : 11g
Framework driver version
.Net Framework 4.6 Oracle.ManagedDataAccess.dll 4.122.19.1
.NetCore 3.1 nuget package Oracle.ManagedDataAccess.Core 2.19.80
I use dnspy.exe to debug into the source code of Oracle.Manageddataaccess.dll , each time ExecuteReader is executed, it will trigger nls_session_parameters query .

ExecuteReader ---> OracleDataReader --->GetSessionInfo ---> GetGlobalizationValues ---> SelectNLSValues ---> ExecuteNonQuery

The results of the SelectNLSValues method are not saved, so you query them every time
Why is it designed like this?
Preserve the value of SESSION_TIME_ZONE as m_sessionProperties property.
11.jpgOne hour requests
12.jpg

Comments
Post Details
Added on Jan 27 2022
0 comments
975 views