Đang chuẩn bị liên kết để tải về tài liệu:
Building Spring 2 Enterprise Applications phần 7

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Trong phần này, chúng tôi sẽ bao gồm những hình thức phân giới cắm mốc giao dịch là một phần của việc phát hành mùa xuân 1,0. Sau đó phát hành mùa xuân thêm các hình thức khác, đáng chú ý nhất là mùa xuân 2,0. Tuy nhiên, phát triển toàn diện mùa xuân nên được nhận thức của các hình thức cũ, | 196 CHAPTER 7 TRANSACTION MANAGEMENT Transaction Demarcation Introduced in Spring 1.0 In this section we ll cover those forms of transaction demarcation that were part of the Spring 1.0 release. Later Spring releases added other forms most notably Spring 2.0. However all-round Spring developers should be aware of these older forms as they have been in common use for many years. Also other transaction-demarcation mechanisms reuse the components that are introduced here. Transactioninterceptor and Proxy Creation The core AOP component in all forms of transaction demarcation is the org.springframework. transaction.interceptor.TransactionInterceptor class. It s an around advice that implements the Methodinterceptor interface see Chapter 3 . Transactioninterceptor is a thread-safe class that starts a transaction before a method is executed and ends it after the method execution exits. Listing 7-3 shows the configuration of Transactioninterceptor in a Spring XML file. Listing 7-3. Configuring Transactioninterceptor beans bean id dataSource class org.apache.commons.dbcp.BasicDataSource destroy-method close property name driverClassName value jdbc.driverClassName property name url value jdbc.url property name username value jdbc.username property name password value jdbc.password bean bean class org.springframework.beans.factory.config. PropertyPlaceholderConfigurer property name location value classpath jdbc.properties bean bean id transactionManager class org.springframework.jdbc.datasource. DataSourceTransactionManager property name dataSource ref dataSource bean bean id transactionInterceptor class org.springframework.transaction.interceptor.TransactionInterceptor property name transactionManager ref transactionManager property name transactionAttributes props prop key endMatch PROPAGATION_REQUIRED prop props property bean beans The transactioninterceptor bean in Listing 7-3 is an around advice configured to use the DataSourceTransactionManager. The other property .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.