You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an inheritance tree using joined tables where a version field for optimistic locking exists for a subclass, but not in the parent. Whenever I try to insert, it fails after executing this query:
SELECT versionLock FROM Car WHERE id = '...';
The exception message is 'Unexpected empty result for database query.'
Current behavior
When using Version for optimistic locking in JOINED subclasses, the refresh fails on new inserts since the inserted version does not exist on the parent subclass, yet it tries to refresh the subclass.
The exception is triggered on the BasicEntityPersister.php file here:
$values = $this->conn->fetchNumeric(
$sql,
array_values($flatId),
$this->extractIdentifierTypes($id, $versionedClass)
);
if ($values === false) {
throw new LengthException('Unexpected empty result for database query.');
}
How to reproduce
Create an inheritance tree. The parent class must define a JOINED inheritance type and a child class must declare a field with the Version annotation. Afterwards, try to insert a child object into the database. This happens with numeric "version" that have a default value assigned by the database engine.
Expected behavior
That the child is inserted properly.
The text was updated successfully, but these errors were encountered:
greg0ire
changed the title
Regression caused by #e369cb6
Regression caused by e369cb6
Jun 15, 2022
Bug Report
Summary
I have an inheritance tree using joined tables where a version field for optimistic locking exists for a subclass, but not in the parent. Whenever I try to insert, it fails after executing this query:
SELECT versionLock FROM Car WHERE id = '...';
The exception message is 'Unexpected empty result for database query.'
Current behavior
When using Version for optimistic locking in JOINED subclasses, the refresh fails on new inserts since the inserted version does not exist on the parent subclass, yet it tries to refresh the subclass.
The exception is triggered on the BasicEntityPersister.php file here:
How to reproduce
Create an inheritance tree. The parent class must define a JOINED inheritance type and a child class must declare a field with the Version annotation. Afterwards, try to insert a child object into the database. This happens with numeric "version" that have a default value assigned by the database engine.
Expected behavior
That the child is inserted properly.
The text was updated successfully, but these errors were encountered: