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 06:12:48 UTC

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

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



##########
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:
       whilst I'd like to track down the _why_ of this instead of skipping over it, I think that may take some time -- I don't even have pgsql installed on any of my machines. As far as I understand, the only side-effect here is that the command might run a little slower, so I'd say, let's put in this workaround, but please put in a comment explaining why, eg `// ignore prepare exceptions as they can happen without affecting actual logging, eg on pgsql`. Thoughts?




----------------------------------------------------------------
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