01: package liquibase.database;
02:
03: import java.sql.Connection;
04: import java.sql.SQLException;
05: import java.sql.Statement;
06:
07: public class DerbyConnectionDelegate extends SQLConnectionDelegate {
08:
09: public DerbyConnectionDelegate(Connection connection) {
10: super (connection);
11: }
12:
13: public void commit() throws SQLException {
14: super .commit();
15:
16: checkPoint();
17: }
18:
19: public void rollback() throws SQLException {
20: super .rollback();
21:
22: checkPoint();
23: }
24:
25: private void checkPoint() throws SQLException {
26: Statement st = null;
27: try {
28: st = createStatement();
29: st.execute("CALL SYSCS_UTIL.SYSCS_CHECKPOINT_DATABASE()");
30: } finally {
31: if (st != null) {
32: st.close();
33: }
34: }
35: }
36: }
|