Write an abort record to the log for the specified tid, force the log to disk, and perform a rollback @param tid The aborting transaction.
(TransactionId tid)
| 147 | @param tid The aborting transaction. |
| 148 | */ |
| 149 | public void logAbort(TransactionId tid) throws IOException { |
| 150 | // must have buffer pool lock before proceeding, since this |
| 151 | // calls rollback |
| 152 | |
| 153 | synchronized (Database.getBufferPool()) { |
| 154 | |
| 155 | synchronized(this) { |
| 156 | preAppend(); |
| 157 | //Debug.log("ABORT"); |
| 158 | //should we verify that this is a live transaction? |
| 159 | |
| 160 | // must do this here, since rollback only works for |
| 161 | // live transactions (needs tidToFirstLogRecord) |
| 162 | rollback(tid); |
| 163 | |
| 164 | raf.writeInt(ABORT_RECORD); |
| 165 | raf.writeLong(tid.getId()); |
| 166 | raf.writeLong(currentOffset); |
| 167 | currentOffset = raf.getFilePointer(); |
| 168 | force(); |
| 169 | tidToFirstLogRecord.remove(tid.getId()); |
| 170 | } |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | /** Write a commit record to disk for the specified tid, |
| 175 | and force the log to disk. |