View Javadoc
1   /*
2    * Copyright 2004-2022 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *    https://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package com.ibatis.sqlmap.engine.transaction;
17  
18  import java.sql.SQLException;
19  import java.util.Properties;
20  
21  import javax.sql.DataSource;
22  
23  /**
24   * The Interface TransactionConfig.
25   */
26  public interface TransactionConfig {
27  
28    /**
29     * New transaction.
30     *
31     * @param transactionIsolation
32     *          the transaction isolation
33     *
34     * @return the transaction
35     *
36     * @throws SQLException
37     *           the SQL exception
38     * @throws TransactionException
39     *           the transaction exception
40     */
41    Transaction newTransaction(int transactionIsolation) throws SQLException, TransactionException;
42  
43    /**
44     * Gets the data source.
45     *
46     * @return the data source
47     */
48    DataSource getDataSource();
49  
50    /**
51     * Sets the data source.
52     *
53     * @param ds
54     *          the new data source
55     */
56    void setDataSource(DataSource ds);
57  
58    /**
59     * This should not be used and is here purely to avoid spring integration from breaking.
60     *
61     * @return -1
62     *
63     * @deprecated
64     */
65    int getMaximumConcurrentTransactions();
66  
67    /**
68     * This should not be used. It does nothing and is here purely to prevent Spring integration from breaking
69     *
70     * @param maximumConcurrentTransactions
71     *          the new maximum concurrent transactions
72     *
73     * @deprecated
74     */
75    void setMaximumConcurrentTransactions(int maximumConcurrentTransactions);
76  
77    /**
78     * Checks if is force commit.
79     *
80     * @return true, if is force commit
81     */
82    boolean isForceCommit();
83  
84    /**
85     * Sets the force commit.
86     *
87     * @param forceCommit
88     *          the new force commit
89     */
90    void setForceCommit(boolean forceCommit);
91  
92    /**
93     * This method should call setProperties. It is here simply to ease transition
94     *
95     * @param props
96     *          - Properties
97     *
98     * @throws SQLException
99     *           the SQL exception
100    * @throws TransactionException
101    *           the transaction exception
102    *
103    * @deprecated
104    */
105   void initialize(Properties props) throws SQLException, TransactionException;
106 
107   /**
108    * Sets the properties.
109    *
110    * @param props
111    *          the new properties
112    *
113    * @throws SQLException
114    *           the SQL exception
115    * @throws TransactionException
116    *           the transaction exception
117    */
118   void setProperties(Properties props) throws SQLException, TransactionException;
119 
120 }