Skip to content

Commit 504c79e

Browse files
committed
Add TransactionAwareDataSourceProxy
1 parent 0a4090b commit 504c79e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

demo-iciql/src/main/java/com/example/PizzaRepository.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import javax.sql.DataSource;
1212

13+
import org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy;
1314
import org.springframework.stereotype.Repository;
1415
import org.springframework.transaction.annotation.Transactional;
1516

@@ -24,7 +25,7 @@ public class PizzaRepository {
2425
private final DataSource dataSource;
2526

2627
public PizzaRepository(DataSource dataSource) {
27-
this.dataSource = dataSource;
28+
this.dataSource = new TransactionAwareDataSourceProxy(dataSource);
2829
}
2930

3031
public List<Pizza> findOrderByIdAsc() {

0 commit comments

Comments
 (0)