Added reconnect to database on execution errors