Re: [Cppcms-users] How to reconnect to MySQL
Brought to you by:
artyom-beilis
|
From: Artyom B. <art...@ya...> - 2011-12-05 20:16:30
|
>
> The opt_reconnect does not work as prepared statements do not survive connection
> lost.
>
Another possible way to solve this problem is to clear prepared statements cache
in case of error.
cppdb::session sql(...)
try {
sql << ...
}catch(cppdb::cppdb_error const &) {
sql.clear_cache();
throw;
}
This would work with opt_reconnect=1, but yet it is a workaround.
Artyom
|