Bug #3786
openWt: fatal error: error executing prepared statement Lost connection to MySQL server during query
Description
after
Dbo::FixedSqlConnectionPool *pool = new Dbo::FixedSqlConnectionPool( new Dbo::backend::MySQL( "db", "login, "pass\" ) );
and
Dbo::Session session_;
session_.setConnectionPool( *pool ) ;
All works fine, but after some time, I get an error:
"Wt: fatal error: error executing prepared statement Lost connection to MySQL server during query"
How can I check that the connection is active?
or how to make it automatically re-created?
thx =)
Files
Updated by Wim Dumon about 9 years ago
Hello Drus,
As far as I know, we do configure mysql to reconnect automatically whenever the connection is lost.
How long is 'some time'?
BR,
Wim.
Updated by Drus Kor about 9 years ago
Hello. Yes, in source code "reconnect automatically" is on, I checked.
just restart Mysql, ore reset connections. It is the fastest way.
In my case connections lost by timeout;
use:
@
static Dbo::FixedSqlConnectionPool pool( new Dbo::backend::MySQL( "db_test", "witty_user", "pass" , 10 );
// constructor section
session_.setConnectionPool( pool ) ;
@
Some additional:
Ubuntu 14.04.1
Mysql 5.5.41
Wt 3.3.3
Updated by Drus Kor about 9 years ago
[[[http://comments.gmane.org/gmane.comp.lib.cppcms.user/968]]]
Updated by Wim Dumon about 9 years ago
Does this solution work for you:
http://comments.gmane.org/gmane.comp.web.witty.general/9994
BR,
Wim.
Updated by Drus Kor about 9 years ago
No, it does not always work.
It can lead to long delays ( performance )
I tried to write a handler of disconnection. But it seems that you are using exceptions to handle logic inside the library.
I attached the file, where I tried to implement error handling logic.
later continue working on it. maybe my decision will be useful.
Updated by Koen Deforche about 9 years ago
- Status changed from New to InProgress
- Assignee set to Wim Dumon
- Target version set to 3.3.4