Description
Downloaded the subject revision 1714197 in order to get the ADONetAppender_SqlServer appender to work as this revision corrected a problem. The appender began to work. However if the BufferSize was increased to >1 an error was reported that the parameter @log_date was already defined.
The error appears to be in SendBuffer. Because the IDbCommand dbCmd is being reused inside the foreach (LoggingEvent e in Events), each time the param.Prepare(dbCmd) is called for the same appender it will attempt to add a parameter that has already been added.
My local solution was to clear the commands parameter list prior to adding the preparing the paramters:
foreach (LoggingEvent e in events)
{
dbCmd.Parameters.Clear(); //****added this line****
// Set the parameter values
foreach (AdoNetAppenderParameter param in m_parameters)
// Execute the query
dbCmd.ExecuteNonQuery();
}
Attachments
Issue Links
- is related to
-
LOG4NET-461 The AdoNetAppender
- Closed