Hello all,
I come to you to getting help for managing multi threading and database connection.
My project use Xml-Rpc to receive messages, so each call come from a different
thread.
Incoming calls are executing SQL on a MysqlConnection .
MysqlConnection does not like when concurents calls appends.
For a fast and dirty solution, I've put a Monitor() at messages arrived.
But I would like to finally got a nicer solution.
What do you think about the architecture I should make ?
Should I create and manage a Pool of MysqlConnection and only locking when pool
is fully occuped ?
Do you know already made solutions for that case ?
Thanks a lot for you comments and ideas,
cyrille.
PS: Before I put the ugly Monitor, I got some errors like :
Exception: Connection must be valid and open. StackTrace:
at MySql.Data.MySq lClient.MySqlCo mmand.CheckStat e()
at MySql.Data.MySq lClient.MySqlCo mmand.ExecuteRe ader(CommandBeh avior behavior)
at MySql.Data.MySq lClient.MySqlCo mmand.ExecuteRe ader()
Exception: Expected prepared statement marker. StackTrace:
at MySql.Data.MySq lClient.NativeD river.Prepare(S tring sql, String[] parmNames)
at MySql.Data.MySq lClient.MySqlCo mmand.Prepare()
I come to you to getting help for managing multi threading and database connection.
My project use Xml-Rpc to receive messages, so each call come from a different
thread.
Incoming calls are executing SQL on a MysqlConnection .
MysqlConnection does not like when concurents calls appends.
For a fast and dirty solution, I've put a Monitor() at messages arrived.
But I would like to finally got a nicer solution.
What do you think about the architecture I should make ?
Should I create and manage a Pool of MysqlConnection and only locking when pool
is fully occuped ?
Do you know already made solutions for that case ?
Thanks a lot for you comments and ideas,
cyrille.
PS: Before I put the ugly Monitor, I got some errors like :
Exception: Connection must be valid and open. StackTrace:
at MySql.Data.MySq lClient.MySqlCo mmand.CheckStat e()
at MySql.Data.MySq lClient.MySqlCo mmand.ExecuteRe ader(CommandBeh avior behavior)
at MySql.Data.MySq lClient.MySqlCo mmand.ExecuteRe ader()
Exception: Expected prepared statement marker. StackTrace:
at MySql.Data.MySq lClient.NativeD river.Prepare(S tring sql, String[] parmNames)
at MySql.Data.MySq lClient.MySqlCo mmand.Prepare()
Comment