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.
One hour requests
