A method for detecting torn writes in a log buffer associated to a particular transaction in a database including a collection of records in a persistent system (220A, 220B) coupled to one or more processors (102; 210A, 210B) via a bus, wherein the persistent system serves as at least part of a main memory, wherein the transaction implements multi-versioning in which a record is not updated in place, the method comprising the following sequence of steps: for each transaction, performing the following: filling a log buffer with a predetermined background bit pattern and persisting the log buffer; saving post-commit processing information in the log buffer upon validation of the transaction, and computing a torn-write guard for the log buffer, wherein computing the torn-write guard for the log buffer comprises associating a bitmap with the log buffer comprising a bit corresponding to each cache line of the log buffer, wherein a corresponding bit is set in the bitmap for a cache line of the log buffer that matches the predetermined background bit pattern, said bit in the bitmap not being set otherwise; including the computed torn-write guard in the log buffer and marking the log buffer as filled; and storing the log buffer in the persistent system; at a recovery time, checking the cache lines of the log buffer, wherein if a cache line does not contain the background bit pattern, concluding that the cache line was persisted, and if the cache line contains the background pattern, checking the bit corresponding to the cache line within the log buffer's bitmap, and if the bit is set, concluding that the cache line was persisted and otherwise concluding that there is a torn write in the cache line, the cache line not having been persisted. for each transaction, performing the following: filling a log buffer with a predetermined background bit pattern and persisting the log buffer; saving post-commit processing information in the log buffer upon validation of the transaction, and computing a torn-write guard for the log buffer, wherein computing the torn-write guard for the log buffer comprises associating a bitmap with the log buffer comprising a bit corresponding to each cache line of the log buffer, wherein a corresponding bit is set in the bitmap for a cache line of the log buffer that matches the predetermined background bit pattern, said bit in the bitmap not being set otherwise; including the computed torn-write guard in the log buffer and marking the log buffer as filled; and storing the log buffer in the persistent system; filling a log buffer with a predetermined background bit pattern and persisting the log buffer; saving post-commit processing information in the log buffer upon validation of the transaction, and computing a torn-write guard for the log buffer, wherein computing the torn-write guard for the log buffer comprises associating a bitmap with the log buffer comprising a bit corresponding to each cache line of the log buffer, wherein a corresponding bit is set in the bitmap for a cache line of the log buffer that matches the predetermined background bit pattern, said bit in the bitmap not being set otherwise; including the computed torn-write guard in the log buffer and marking the log buffer as filled; and storing the log buffer in the persistent system; at a recovery time, checking the cache lines of the log buffer, wherein if a cache line does not contain the background bit pattern, concluding that the cache line was persisted, and if the cache line contains the background pattern, checking the bit corresponding to the cache line within the log buffer's bitmap, and if the bit is set, concluding that the cache line was persisted and otherwise concluding that there is a torn write in the cache line, the cache line not having been persisted.