Add reconnect

reconnect to database for restarting or timeout