various fixes, mostly around better writes for mysql
set timeout in session