[ 
https://issues.apache.org/jira/browse/LOG4NET-442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14157931#comment-14157931
 ] 

Alessio Sanguineti commented on LOG4NET-442:
--------------------------------------------

We tried to rebuild our application under .NET framework 3.0 and the logger 
worked properly.
It doesn't seem named pipes could be a probem, as we are using TCP connection 
to the SQL Server.

Actually, we debugged log4net and discovered, using the 4.5 framework, that as 
you guessed the SqlConnection state stays "Open" even if the connection is 
broken, so log4net doen't recognize the problem and doesn't refresh the 
connection.

So, at the moment we implemented a workaround so that when an exception is 
thrown in the SendBuffer portion of the code, a "SELECT 1" query is performed 
and, if it fails too, the connection is refreshed.

This way the logger works fine even after disconnection..

Thank you for your help.
Regards.

> ReconnectOnError 
> -----------------
>
>                 Key: LOG4NET-442
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-442
>             Project: Log4net
>          Issue Type: Bug
>          Components: Builds
>    Affects Versions: 1.2.13
>         Environment: Microsoft .NET 4.5
>            Reporter: Alessio Sanguineti
>         Attachments: log4net.txt
>
>
> Hello, in our .NET application using Log4Net to log on a Sql Server 2014 
> database, we set the parameter "ReconnectOnError" to true in the ADO.Net 
> Appender configuration. 
> Even if the property seems to be read correctly (as visible on the log), 
> whenever the server is not reachable for a while the appender does not 
> reconnect anymore thus not logging anything else.
> We get the log file attached of a test where we turned off SQL Server for 
> about 1 minute before restarting it.
> Thank you.
> Regards



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to