Hi Max,
if you want to test, if a db connection is still alive, one may issue
a "db configure" option.
Here is a code snippet:
proc ::wwwbase::getDbConnection {} {
set args {-user me -passwd my -host 127.0.0.1 -database products}
if {[info commands ::db] ne ""} {
## Already have a connection.
if {![catch {::db configure {*}$args} error]} {
return 0
}
catch {::db close}
}
# > Catch to not show the password in the log
if {[catch {
tdbc::mysql::connection create ::db {*}$args
} Err]} {
return -code error "No data base connection"
}
return 1
}