View Javadoc
1   /*
2    * Copyright 2004-2025 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    @Deprecated
66    int getMaximumConcurrentTransactions();
67  
68    /**
69     * This should not be used. It does nothing and is here purely to prevent Spring integration from breaking
70     *
71     * @param maximumConcurrentTransactions
72     *          the new maximum concurrent transactions
73     *
74     * @deprecated
75     */
76    @Deprecated
77    void setMaximumConcurrentTransactions(int maximumConcurrentTransactions);
78  
79    /**
80     * Checks if is force commit.
81     *
82     * @return true, if is force commit
83     */
84    boolean isForceCommit();
85  
86    /**
87     * Sets the force commit.
88     *
89     * @param forceCommit
90     *          the new force commit
91     */
92    void setForceCommit(boolean forceCommit);
93  
94    /**
95     * This method should call setProperties. It is here simply to ease transition
96     *
97     * @param props
98     *          - Properties
99     *
100    * @throws SQLException
101    *           the SQL exception
102    * @throws TransactionException
103    *           the transaction exception
104    *
105    * @deprecated
106    */
107   @Deprecated
108   void initialize(Properties props) throws SQLException, TransactionException;
109 
110   /**
111    * Sets the properties.
112    *
113    * @param props
114    *          the new properties
115    *
116    * @throws SQLException
117    *           the SQL exception
118    * @throws TransactionException
119    *           the transaction exception
120    */
121   void setProperties(Properties props) throws SQLException, TransactionException;
122 
123 }