1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package com.ontotext.ordi;
19
20 import com.ontotext.ordi.exception.ORDIException;
21
22 /**
23 * A connection (session) to specific data provider. The {@link Connection}
24 * interface define common functionality to be supported by specific data
25 * provider.
26 *
27 * @author vassil
28 *
29 */
30 public interface Connection extends Wrapper, WarningAware {
31
32 /**
33 * Checks if the the current session is in auto-commit mode.
34 *
35 * @return true if it is auto-commit mode.
36 */
37 public boolean isAutoCommit();
38
39 /**
40 * Sets the commit mode of the current transaction.
41 *
42 * @param mode
43 * true for auto-commit, otherwise false
44 * @throws ORDIException
45 */
46 public void setAutoCommit(boolean mode) throws ORDIException;
47
48 /**
49 * Rollbacks all operations part of the current transaction.
50 *
51 * @throws ORDIException
52 */
53 public void rollback() throws ORDIException;
54
55 /**
56 * Commits all operations part of the current transaction.
57 *
58 * @throws ORDIException
59 */
60 public void commit() throws ORDIException;
61
62 /**
63 * Gets the isolation level of the current transaction.
64 *
65 * @return isolation level
66 */
67 public IsolationLevel getTransactionIsolationLevel();
68
69 /**
70 * Sets the isolation level of the current transaction.
71 *
72 * @param isolationLevel
73 * to be used
74 */
75 public void setTransactionIsolationLevel(IsolationLevel isolationLevel)
76 throws ORDIException;
77
78 /**
79 * Checks if the current session to data provider is read-only.
80 *
81 * @return true if read-only
82 */
83 public boolean isReadOnly();
84
85 /**
86 * Checks if this session is opened.
87 *
88 * @return true if closed, false otherwise.
89 */
90 public boolean isOpen();
91
92 /**
93 * Releases all resources hold by this instance.
94 *
95 * @throws ORDIException
96 */
97 public void close() throws ORDIException;
98
99 /**
100 * Gets the {@link DataSource} this session is using.
101 *
102 * @return data source that created this sessions
103 */
104 public DataSource getDataSource();
105 }