The AdoNetAppender tries to open the connection to the database at configure time.
When the appender tries to send a batch of updates the database and the connection is not open, and ReconnectOnError is set then it will attempt to reopen the connection once. > I want to understand the behaviour of adonetappender with > "reconnectonerror" > property set to true for following scenarios.. > > 1) When I call XMLCOnfigurator.Configure and at that time > database is down > 1.1 What happens to subsequent log calls on that adonetappender? Each time a batch is sent (when depends on your BufferSize and other settings) the connection will be opened if it is not already open. > 1.2 Will the appender keep trying to connect in an endless loop? No it will try to call open at most once for each batch. If the connection cannot be opened then the batch of events will be discarded. > 2) When I call XMLCOnfigurator.Configure and at that time > database is up but later it goes down > 2.1 What happens to subsequent log calls on that adonetappender? The first time that the database is not available an exception will be thrown (timeout), the batch of events will be discarded. For then on, until the connection is re-established each time a batch is sent the connection will try to be opened. > 2.2 Will the appender keep trying to connect in an endless loop? No, but it will discard the logging events it is unable to deliver to the database. While the appender is trying to reconnect to the database it may be blocking your calling application, up to the connection timeout specified in the connection string. Nicko > > Thanks, > Hemant > >
