As shown in the code snippet below, this requires keeping a counter so you know when to commit and write a log record, taking care not to count rows that cause an exception.
如下面的代码段所示,这需要维护一个计数器,以便能够知道什么时候进行提交并写日志记录,这个计数器不考虑导致异常的行。
When a call to the log method is found, we check to see if the program counter is outside the if block determined earlier.
找到对log方法的调用后,我们检查程序计数器是否在前面确定的if块外面。
A way to counter the journal corruption is to compute a checksum of the transaction log and write it as part of the commit block process.
对付该问题的一个办法就是,计算一个事务日志的校验和,并把它作为commit block过程的一部分写到日志中。
应用推荐