Using Transactions with Pooled Connections

[ Team LiB ] Recipe Using Transactions with Pooled Connections Problem You want to use connection pooling with transactions in your .NET application to maximize performance. Solution The discussion explains how to use connection pooling with transactions. | Team LiB Recipe Using Transactions with Pooled Connections Problem You want to use connection pooling with transactions in your .NET application to maximize performance. Solution The discussion explains how to use connection pooling with transactions. Discussion Connections participating in transactions are drawn from the connection pool and assigned based on an exact match with the transaction context of the requesting thread and with the connection string. Each connection pool is divided into a subdivision for connections without a transaction context and zero or more subdivisions for connections associated with a particular transaction context. Each of these subdivisions whether associated with a transaction context or not uses connection pooling based on exact matching of the connection string as described in Recipe . When a thread associated with a particular transaction context requests a connection one from the appropriate pool enlisted with that transaction is automatically returned. When a connection is closed it is returned to the appropriate subdivision in the connection pool based on the transaction context. This allows a connection to be closed without generating an error even if a distributed transaction is still pending. The transaction can committed or aborted later. Team LiB

Bấm vào đây để xem trước nội dung
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.