Skip to content

Commit 37a1408

Browse files
committed
Ignore transient attributes when checking optimistic object locks
1 parent 202c4a5 commit 37a1408

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/wcmf/lib/persistence/concurrency/impl/DefaultConcurrencyManager.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ public function checkPersist(PersistentObject $object) {
142142
$mapper = $this->persistenceFacade->getMapper($object->getType());
143143
$it = new NodeValueIterator($originalState, false);
144144
foreach($it as $valueName => $originalValue) {
145-
$attribute = $mapper->getAttribute($valueName);
146-
// ignore references
147-
if (!($attribute instanceof ReferenceDescription) && !($attribute instanceof TransientAttributeDescription)) {
145+
$attribute = $mapper->hasAttribute($valueName) ? $mapper->getAttribute($valueName) : null;
146+
// ignore references and transient values
147+
if ($attribute && !($attribute instanceof ReferenceDescription) && !($attribute instanceof TransientAttributeDescription)) {
148148
$currentValue = $currentState->getValue($valueName);
149149
if (strval($currentValue) != strval($originalValue)) {
150150
if (self::$logger->isDebugEnabled()) {

0 commit comments

Comments
 (0)