diff --git a/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php b/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php index 4cbe11ee9..e9750f8c3 100644 --- a/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php +++ b/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php @@ -365,6 +365,7 @@ class JoinedSubclassPersister extends AbstractEntityInheritancePersister */ public function getLockTablesSql() { + $idColumns = $this->_class->getIdentifierColumnNames(); $baseTableAlias = $this->_getSQLTableAlias($this->_class->name); // INNER JOIN parent tables diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php new file mode 100644 index 000000000..c5d95e490 --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php @@ -0,0 +1,37 @@ +useModelSet('company'); + parent::setUp(); + } + + /** + * @group DDC-933 + */ + public function testLockCTIClass() + { + $manager = new \Doctrine\Tests\Models\Company\CompanyManager(); + $manager->setName('beberlei'); + $manager->setSalary(1234); + $manager->setTitle('Vice Precident of This Test'); + $manager->setDepartment("Foo"); + + $this->_em->persist($manager); + $this->_em->flush(); + + $this->_em->beginTransaction(); + $this->_em->lock($manager, \Doctrine\DBAL\LockMode::PESSIMISTIC_READ); + $this->_em->rollback(); + } +} \ No newline at end of file