1 65 66 67 package org.hsqldb; 68 69 76 class Transaction { 77 78 boolean isDelete; 79 Table tTable; 80 Row row; 81 long SCN; 82 83 93 Transaction(boolean delete, Table table, Row row, long SCN) { 94 95 isDelete = delete; 96 tTable = table; 97 this.row = row; 98 } 99 100 107 void rollback(Session session, boolean log) { 108 109 try { 110 if (isDelete) { 111 tTable.insertNoCheckRollback(session, row, log); 112 } else { 113 tTable.deleteNoCheckRollback(session, row, log); 114 } 115 } catch (Exception e) { 116 117 } 119 } 120 121 void commit(Session session) { 122 123 try { 124 if (isDelete) { 125 tTable.removeRowFromStore(row); 126 } else { 127 tTable.commitRowToStore(row); 128 } 129 } catch (Exception e) { 130 131 } 133 } 134 135 void logRollback(Session session) { 136 137 try { 138 if (isDelete) { 139 tTable.database.logger.writeInsertStatement(session, tTable, 140 row.getData()); 141 } else { 142 tTable.database.logger.writeDeleteStatement(session, tTable, 143 row.getData()); 144 } 145 } catch (Exception e) {} 146 } 147 148 void logAction(Session session) { 149 150 try { 151 if (isDelete) { 152 tTable.database.logger.writeDeleteStatement(session, tTable, 153 row.getData()); 154 } else { 155 tTable.database.logger.writeInsertStatement(session, tTable, 156 row.getData()); 157 } 158 } catch (Exception e) {} 159 } 160 } 161 | Popular Tags |