You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by GitBox <gi...@apache.org> on 2020/12/08 09:28:20 UTC

[GitHub] [logging-log4net] NicholasNoise commented on a change in pull request #71: Fix AdoNetAppender using npgsql

NicholasNoise commented on a change in pull request #71:
URL: https://github.com/apache/logging-log4net/pull/71#discussion_r538174819



##########
File path: src/log4net/Appender/AdoNetAppender.cs
##########
@@ -553,8 +553,17 @@ protected virtual void SendBuffer(IDbTransaction dbTran, LoggingEvent[] events)
 					{
 						dbCmd.Transaction = dbTran;
 					}
-					// prepare the command, which is significantly faster
-					dbCmd.Prepare();
+
+					try
+					{
+						// prepare the command, which is significantly faster
+						dbCmd.Prepare();
+					}
+					catch (Exception)
+					{
+						// Ignore exception

Review comment:
       I've investigated it. The simple _why_ is to prepare a valid command instead of invalid one without parameters and values.
   Also tracked down to inner command cache, so it is not necessary to prepare command.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org