Connection and transaction management