Enterprise Logging automatically runs sql query which sets NLS SESSION PARAMETERS

Topics: Logging Application Block
May 14, 2014 at 3:17 PM
Hello,

Hope you’re doing good !!

We’re using logging block of Enterprise Library 6.
We conducted a performance test to review the impact of logging. The test was monitored using Wily introscope.

Issue:
There was an unknown query being executed while logging and we’re not sure why/how it is been triggered .

Unknown Query:
DECLARE ERR_CODE VARCHAR2 (?) ; ERR_MSG VARCHAR2 (?) ; BEGIN EXECUTE IMMEDIATE ? ;
SELECT VALUE INTO _ P_NLS_CALENDAR FROM NLS_SESSION_PARAMETERS WHERE PARAMETER = ? ;
SELECT VALUE INTO _ P_NLS_COMP FROM NLS_SESSION_PARAMETERS WHERE PARAMETER = ? ;
SELECT VALUE INTO _ P_NLS_LENGTH_SEMANTICS FROM NLS_SESSION_PARAMETERS WHERE PARAMETER = ? ;
SELECT VALUE INTO _ P_NLS_NCHAR_CONV_EXCEP FROM NLS_SESSION_PARAMETERS WHERE PARAMETER = ? ;
SELECT VALUE INTO _ P_NLS_DATE_LANG FROM NLS_SESSION_PARAMETERS WHERE PARAMETER = ? ;
SELECT VALUE INTO _ P_NLS_SORT FROM NLS_SESSION_PARAMETERS WHERE PARAMETER = ? ;
SELECT VALUE INTO _ P_NLS_CURRENCY FROM NLS_SESSION_PARAMETERS WHERE PARAMETER = ? ;
SELECT VALUE INTO _ P_NLS_DATE_FORMAT FROM NLS_SESSION_PARAMETERS WHERE PARAMETER = ? ;
SELECT VALUE INTO _ P_NLS_ISO_CURRENCY FROM NLS_SESSION_PARAMETERS WHERE PARAMETER = ? ;
SELECT VALUE INTO _ P_NLS_NUMERIC_CHARS FROM NLS_SESSION_PARAMETERS WHERE PARAMETER = ? ;
SELECT VALUE INTO _ P_NLS_DUAL_CURRE...

Additional Information:
The unknown query is not executed for each database access. Its random.

Local Environment:
Windows 7, 64 bit, VS 2012, .NET 4.5, Enterprise Library 6.

Have you heard about this issue before? It would be great if you could give us some reference or suggestions regarding the issue.
May 15, 2014 at 1:58 PM
The posted SQL does not appear like it is being sent by Enterprise Library. It looks as though you are using Oracle. I'm not an Oracle expert but I would guess that the the Oracle provider is setting those values. Perhaps the values are only set when initializing a new connection session which might explain the apparent randomness.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to