[DDC-1624] Locking CTI doesnt work on SQL Server Created: 29/Jan/12  Updated: 19/Aug/14  Resolved: 19/Aug/14

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.2
Fix Version/s: 2.5
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Marco Pivetta
Resolution: Fixed Votes: 1
Labels: None

Issue Links:
is duplicated by DBAL-559 SQL Server Platform error on LOCK MOD... Resolved


The WITH Keyowrd is appended to the whole FROM .. JOIN .. block instead of behind the FROM block.

Comment by Bill Schaller [ 03/Oct/13 ]

Is there a better workaround for this issue than this?

diff --git a/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php b/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
index c9af278..2f192ea 100644
--- a/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
+++ b/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
@@ -1020,7 +1020,7 @@ class SQLServerPlatform extends AbstractPlatform
                 $lockClause = '';
-        return $fromClause . $lockClause;
+        return $fromClause;// . $lockClause;

I've just been keeping my own fork of DBAL to work around this bug, but it would be nice if it was fixed. Bad thing is that I see no convenient or non-obfuscated way of doing it, so I don't feel comfortable submitting a patch.

This is pretty severe, as it completely breaks select queries against entities with inheritance.

Comment by Bill Schaller [ 19/Aug/14 ]

I think this is fixed in 2.4...

Comment by Marco Pivetta [ 19/Aug/14 ]

Already solved in 2.4 indeed.

Generated at Tue Oct 13 19:09:31 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.