1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.mybatis.spring.transaction;
17
18 import java.sql.Connection;
19 import java.util.Properties;
20
21 import javax.sql.DataSource;
22
23 import org.apache.ibatis.session.TransactionIsolationLevel;
24 import org.apache.ibatis.transaction.Transaction;
25 import org.apache.ibatis.transaction.TransactionFactory;
26
27
28
29
30
31
32 public class SpringManagedTransactionFactory implements TransactionFactory {
33
34 @Override
35 public Transaction newTransaction(DataSource dataSource, TransactionIsolationLevel level, boolean autoCommit) {
36 return new SpringManagedTransaction(dataSource);
37 }
38
39 @Override
40 public Transaction newTransaction(Connection conn) {
41 throw new UnsupportedOperationException("New Spring transactions require a DataSource");
42 }
43
44 @Override
45 public void setProperties(Properties props) {
46
47 }
48
49 }