Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4080048
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:52:49+00:00 2026-05-20T17:52:49+00:00

I am facing a trouble with an AdoNetAppender. Things work fine for messages upto

  • 0

I am facing a trouble with an AdoNetAppender. Things work fine for messages upto 2000 chars length. Everything falls apart if the message(PI_S_MESSAGE) is > 2000 chars. My database is Oracle 10g and shown below is the appender config. Connect string is injected on the fly, when initializing the appender.

<?xml version="1.0" encoding="utf-8" ?><log4net>
<appender name="MyAppender" type="log4net.Appender.AdoNetAppender">
  <bufferSize value="0" />
  <connectionType value="System.Data.OracleClient.OracleConnection, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />      
  <commandText value="INSERT INTO LOG_TABLE(Datetime,Log_Level,userid,Message,machine) VALUES (:PI_D_DATE, :PI_S_LEVEL, :PI_S_USERID, :PI_S_MESSAGE, :PI_S_MACHINE)" />      
  <parameter>
    <parameterName value=":PI_D_DATE" />
    <dbType value="DateTime" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%d{dd-MMM-yyyy HH:mm:ss}" />
    </layout>
  </parameter>     
  <parameter>
    <parameterName value=":PI_S_LEVEL" />
    <dbType value="String" />
    <size value="10" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%level" />
    </layout>
  </parameter>     
  <parameter>
    <parameterName value=":PI_S_USERID" />
    <dbType value="String" />
    <size value="255" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%u" />
    </layout>
  </parameter>
  <parameter>
    <parameterName value=":PI_S_MESSAGE" />
    <dbType value="String" />
    <size value="4000" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%message" />
    </layout>
  </parameter>
  <parameter>
    <parameterName value=":PI_S_MACHINE" />
    <dbType value="String" />
    <size value="255" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%property{log4net:HostName}" />
    </layout>
  </parameter>
</appender>
<root>
  <level value="All"/>
  <appender-ref ref="MyAppender"/>
</root>

When debug mode is enabled, it pumps out an oracle error

log4net:ERROR [AdoNetAppender] Exception while writing to database
System.Data.OracleClient.OracleException: ORA-01461: can bind a LONG value only for insert into a LONG column

   at System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc)

Can someone please help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T17:52:49+00:00Added an answer on May 20, 2026 at 5:52 pm

    Fixed by changing the dbType attribute for the PI_S_MESSAGE parameter to AnsiString.
    Perhaps it was trying an nvarchar binding when used with a dbType as String.

    Eventhough unrelated, this thread saved my arse.
    https://forum.hibernate.org/viewtopic.php?p=2369841

    New config follow.

    <?xml version="1.0" encoding="utf-8" ?><log4net>
    <appender name="MyAppender" type="log4net.Appender.AdoNetAppender">
      <bufferSize value="0" />
      <connectionType value="System.Data.OracleClient.OracleConnection, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />      
      <commandText value="INSERT INTO LOG_TABLE(Datetime,Log_Level,userid,Message,machine) VALUES (:PI_D_DATE, :PI_S_LEVEL, :PI_S_USERID, :PI_S_MESSAGE, :PI_S_MACHINE)" />      
      <parameter>
        <parameterName value=":PI_D_DATE" />
        <dbType value="DateTime" />
        <layout type="log4net.Layout.PatternLayout">
          <conversionPattern value="%d{dd-MMM-yyyy HH:mm:ss}" />
        </layout>
      </parameter>     
      <parameter>
        <parameterName value=":PI_S_LEVEL" />
        <dbType value="String" />
        <size value="10" />
        <layout type="log4net.Layout.PatternLayout">
          <conversionPattern value="%level" />
        </layout>
      </parameter>     
      <parameter>
        <parameterName value=":PI_S_USERID" />
        <dbType value="String" />
        <size value="255" />
        <layout type="log4net.Layout.PatternLayout">
          <conversionPattern value="%u" />
        </layout>
      </parameter>
      <parameter>
        <parameterName value=":PI_S_MESSAGE" />
        <dbType value="AnsiString" />
        <size value="4000" />
        <layout type="log4net.Layout.PatternLayout">
          <conversionPattern value="%message" />
        </layout>
      </parameter>
      <parameter>
        <parameterName value=":PI_S_MACHINE" />
        <dbType value="String" />
        <size value="255" />
        <layout type="log4net.Layout.PatternLayout">
          <conversionPattern value="%property{log4net:HostName}" />
        </layout>
      </parameter>
    </appender>
    <root>
      <level value="All"/>
      <appender-ref ref="MyAppender"/>
    </root>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have been facing serious trouble in making work cucumber-js in windows. i start
I am just facing trouble to sort out the query I need. I have
I am facing trouble with indent and align format of pdf generated in Red
I am using magento 1.4 (wamp) . I am facing trouble to save cms
I am facing some trouble trying to configure a particular configuration for a NumericUpDown
Am facing a bit of trouble getting the 'combined fragment' to sit above an
I'm facing some trouble to find the best way to return an struct with
I'm facing some trouble when using the class QNetworkAccessManager . I use it to
We are facing trouble restarting closing a running *.JAR file started with the java
Related to my Question , I am facing trouble getting all elements I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.