in reply to Can Log4perl's DBI Appender be used in multithread?
As you discovered, most DBI interfaces don't like it when you create multiple threads and they each try to use the same database handle. This is nothing to to with log4perl.
Assuming your database will allow multiple clients to connect at once. (Almost all do), then the simple solution is for each thread to have it's own database connection.
Off the top of my head I don't know how to make the DBI appender create a new connection, but there should be a way do to it, as this will be a common problem.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can Log4perl's DBI Appender be used in multithread?
by BruceCui (Initiate) on Apr 14, 2011 at 01:55 UTC | |
by afoken (Chancellor) on Apr 14, 2011 at 09:38 UTC |