logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Dingwall (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (LOG4NET-202) AdoNetAppenderParameter.Size Property is not optional
Date Tue, 06 Nov 2012 19:32:13 GMT

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

Richard Dingwall edited comment on LOG4NET-202 at 11/6/12 7:31 PM:
-------------------------------------------------------------------

Meltan yes I know there is a workaround. That is not the issue. The purpose of this issue
is to fix the documentation which still says (more than 3 and a half years since I raised
this issue!), "This property is optional": http://logging.apache.org/log4net/release/sdk/log4net.Appender.AdoNetAppenderParameter.Size.html.

Either:

1. This line needs to be removed from the documentation and a note added (Stefan may have
already done this), OR
2. If dbType is String and no size is specified, log4net should implicitly set size = -1 
under the covers. That way it really _will_ be optional and the documentation will be correct.
                
      was (Author: rdingwall):
    Meltan yes I know there is a workaround. That is not the issue. The purpose of this issue
is to fix the documentation which still says (more than 3 and a half years since I raised
this issue), "This property is optional": http://logging.apache.org/log4net/release/sdk/log4net.Appender.AdoNetAppenderParameter.Size.html.

Either:

1. This line needs to be removed from the documentation and a note added (Stefan may have
already done this), OR
2. If dbType is String and no size is specified, log4net should implicitly set size = -1 
under the covers. That way it really _will_ be optional and the documentation will be correct.
                  
> AdoNetAppenderParameter.Size Property is not optional
> -----------------------------------------------------
>
>                 Key: LOG4NET-202
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-202
>             Project: Log4net
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 1.2.10, 1.2.11
>         Environment: Windows Server 2008, .NET 3.5 SP1, SQL Server 2008
>            Reporter: Richard Dingwall
>             Fix For: 1.2.12
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> The AdoNetAppenderParameter.Size page (http://logging.apache.org/log4net/release/sdk/log4net.Appender.AdoNetAppenderParameter.Size.html)
says "This property is optional. If not specified the ADO.NET provider will attempt to infer
the size from the value."
> However, I just got the following exception in the log4net internal debug trace, with
the following parameter (maps to a VARCHAR(MAX)):
> <parameter>
>       <parameterName value="@exception" />
>       <dbType value="String" />
>       <layout type="log4net.Layout.ExceptionLayout" />
> </parameter>
> log4net:ERROR [AdoNetAppender] Could not prepare database command [INSERT INTO ....]
> System.InvalidOperationException: SqlCommand.Prepare method requires all variable length
parameters to have an explicitly set non-zero Size.
>    at System.Data.SqlClient.SqlParameter.Prepare(SqlCommand cmd)
>    at System.Data.SqlClient.SqlCommand.Prepare()
>    at log4net.Appender.AdoNetAppender.InitializeDatabaseCommand()
> This would suggest the Size parameter cannot be null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message