Ron and Michael thanks for your suggestions,
 
It is indeed how SQLite works and the locking itself is not the problem.
This is expected as multiple processes try to log at once. 
 
The ADODBAppender uses a internal buffer to store the logevents. The
problem is that with default timeout for the DBCommand of 30 seconds
(which is specified in the ADODBAppender) I experience out of memory
exceptions as the internal buffers grow too fast while waiting for the
timeout. 
 
A timeout of say 5s would be better for me. Or better make the timeout
configurable through the config file of the ADODBAppender.
 
What would be the best way to make the neccessary changes? Create my own
version of the ADODBAppender? 
 
Thanks for any reactions,
 
Patrick
 

 
________________________________

Van: Ron Grabowski [mailto:rongrabow...@yahoo.com] 
Verzonden: Wednesday, August 19, 2009 3:36 AM
Aan: Log4NET User
Onderwerp: Re: Experiencing locks while using AdoNetAppender


I think that's how SQLite works. Have you tried writing to a single .db
file from multiple threads without using log4net?


________________________________

From: Patrick Kalkman <p...@hoogendoorn.nl>
To: log4net-user@logging.apache.org
Sent: Tuesday, August 18, 2009 8:29:17 AM
Subject: Experiencing locks while using AdoNetAppender 



Hi, 

I am using the AdoNetAppender for logging messages from multiple
application. All the applications log into one sqllite database.
Sometimes when a lot of information is logged I am experiencing
exceptions like:

log4net:ERROR [AdoNetAppender] Exception while writing to database
System.Data.SQLite.SQLiteException: The database file is locked
database is locked
at System.Data.SQLite.SQLite3.Reset(SQLiteStatement stmt)
at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)
at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery()
at System.Data.SQLite.SQLiteTransaction..ctor(SQLiteConnection
connection, Boolean deferredLock)
at System.Data.SQLite.SQLiteConnection.BeginTransaction(Boolean
deferredLock)
at System.Data.SQLite.SQLiteConnection.BeginDbTransaction(IsolationLevel
isolationLevel)
at
System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransacti
on()
at log4net.Appender.AdoNetAppender.SendBuffer(LoggingEvent[] events) 

The default CommandTimeout in the AdoNetAppender on the IDbCommand is 30
seconds, but I would like to influence this timeout in the log4net
configuration (file) so that I can influence the timeout on the logging
if the database is locked for a longer portion of time. Reducing the
timeout may lead to events getting lost, but I prefer that to our
application hanging for the full CommandTimeout waiting for the database
to become unlocked.

Is it possible to configure the timeout using configuration? or would it
be better to choose for a solution like deriving from the AdoNetAppender
and add the functionality?

Thanks in advance for any answers. 

Patrick 

**********************DISCLAIMER**********************
Deze E-mail is uitsluitend bestemd voor de geadresseerde(n). 
Verstrekking aan en gebruik door anderen is niet toegestaan. 
De Hoogendoorn Groep sluit iedere aansprakelijkheid uit die 
voortvloeit uit elektronische verzending.
This E-mail is intended exclusively for the addressee(s), 
and may not be passed on to, or made available for use by 
any person other than the addressee(s). 
The Hoogendoorn Group rules out any and every liability 
resulting from any electronic transmission.
*******************************************************
This message has been scanned by Network Associates' 
McAfee AntiVirus Technology

Reply via email to