database: support reconnection.