1 | |
package liquibase.database.jvm; |
2 | |
|
3 | |
import liquibase.exception.DatabaseException; |
4 | |
|
5 | |
import java.sql.Connection; |
6 | |
import java.sql.SQLException; |
7 | |
import java.sql.Statement; |
8 | |
|
9 | |
public class HsqlConnection extends JdbcConnection { |
10 | |
|
11 | |
public HsqlConnection(Connection connection) { |
12 | 0 | super(connection); |
13 | 0 | } |
14 | |
|
15 | |
@Override |
16 | |
public void commit() throws DatabaseException { |
17 | 0 | super.commit(); |
18 | |
|
19 | 0 | Statement st = null; |
20 | |
try { |
21 | 0 | st = createStatement(); |
22 | 0 | st.execute("CHECKPOINT"); |
23 | 0 | } catch (SQLException e) { |
24 | 0 | throw new DatabaseException(e); |
25 | |
} finally { |
26 | 0 | if (st != null) { |
27 | |
try { |
28 | 0 | st.close(); |
29 | 0 | } catch (SQLException e) { |
30 | |
; |
31 | 0 | } |
32 | |
} |
33 | |
} |
34 | 0 | } |
35 | |
|
36 | |
@Override |
37 | |
public void rollback() throws DatabaseException { |
38 | 0 | super.rollback(); |
39 | |
|
40 | 0 | Statement st = null; |
41 | |
try { |
42 | 0 | st = createStatement(); |
43 | 0 | st.execute("CHECKPOINT"); |
44 | 0 | } catch (SQLException e) { |
45 | 0 | throw new DatabaseException(e); |
46 | |
} finally { |
47 | 0 | if (st != null) { |
48 | |
try { |
49 | 0 | st.close(); |
50 | 0 | } catch (SQLException e) { |
51 | |
; |
52 | 0 | } |
53 | |
} |
54 | |
} |
55 | 0 | } |
56 | |
} |