Danh mục

Using Transactions with Pooled Connections

Số trang: 1      Loại file: pdf      Dung lượng: 24.50 KB      Lượt xem: 13      Lượt tải: 0    
Hoai.2512

Phí lưu trữ: miễn phí Tải xuống file đầy đủ (1 trang) 0
Xem trước 1 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

[ Team LiB ] Recipe 1.17 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.
Nội dung trích xuất từ tài liệu:
Using Transactions with Pooled Connections[ Team LiB ]Recipe 1.17 Using Transactions with Pooled ConnectionsProblemYou want to use connection pooling with transactions in your .NET application tomaximize performance.SolutionThe discussion explains how to use connection pooling with transactions.DiscussionConnections participating in transactions are drawn from the connection pool andassigned based on an exact match with the transaction context of the requesting threadand with the connection string.Each connection pool is divided into a subdivision for connections without a transactioncontext and zero or more subdivisions for connections associated with a particulartransaction context. Each of these subdivisions, whether associated with a transactioncontext or not, uses connection pooling based on exact matching of the connection stringas described in Recipe 1.15.When a thread associated with a particular transaction context requests a connection, onefrom the appropriate pool enlisted with that transaction is automatically returned.When a connection is closed it is returned to the appropriate subdivision in theconnection pool based on the transaction context. This allows a connection to be closedwithout generating an error even if a distributed transaction is still pending. Thetransaction can committed or aborted later.[ Team LiB ]

Tài liệu được xem nhiều: