You are here

constant CacheTagsChecksumInterface::INVALID_CHECKSUM_WHILE_IN_TRANSACTION in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Cache/CacheTagsChecksumInterface.php \Drupal\Core\Cache\CacheTagsChecksumInterface::INVALID_CHECKSUM_WHILE_IN_TRANSACTION

The invalid checksum returned if a database transaction is in progress.

Every cache backend SHOULD detect this and not write cache items that have this checksum. Not detecting this would not yield incorrect cache reads, but would be a useless write.

While a database transaction is progress, cache tag invalidations are delayed to occur just before the commit, to allow:

  • deadlock potential to be minimized, since semaphores to avoid concurrent writes can be acquired for the shortest period possible
  • Non-database-based implementations of this service can delay tag invalidations until the transaction is committed to avoid race conditions.

File

core/lib/Drupal/Core/Cache/CacheTagsChecksumInterface.php, line 36

Class

CacheTagsChecksumInterface
Provides checksums for cache tag invalidations.

Namespace

Drupal\Core\Cache

Code

const INVALID_CHECKSUM_WHILE_IN_TRANSACTION = -1;