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:
[email protected]


Reply via email to