<!-- 
RSS generated by JIRA (5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5) at Thu May 23 01:36:11 UTC 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.doctrine-project.org/jira/si/jira.issueviews:issue-xml/DDC-2310/DDC-2310.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Doctrine Project</title>
    <link>http://www.doctrine-project.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.7</version>
        <build-number>850</build-number>
        <build-date>21-02-2013</build-date>
    </build-info>

<item>
            <title>[DDC-2310] Recent changes to DBAL SQL Server platform lock hinting breaks ORM SqlWalker in DQL queries with joins</title>
                <link>http://www.doctrine-project.org/jira/browse/DDC-2310</link>
                <project id="10032" key="DDC">Doctrine 2 - ORM</project>
                        <description>&lt;p&gt;The SQL Server platform throws an error when you try to run DQL with JOIN statements.&lt;/p&gt;

&lt;p&gt;The breaking change was in the DBAL SQL Server platform &amp;#8211; it was changed to add a &apos; WITH (NOLOCK)&apos; to the appendLockHint function. Change was in &lt;a href=&quot;https://github.com/doctrine/dbal/commit/6af7845cc3779176ec7e111200fe69654179eaf8#L0R851&quot; class=&quot;external-link&quot;&gt;this rev&lt;/a&gt;. The change in DBAL is not wrong, it just highlighted the bug in the ORM...&lt;/p&gt;


&lt;p&gt;The ORM SqlWalker runs the appendLockHint function against a generated FROM / JOIN clause in the walkFromClause func &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/1bcda5147a890a8f419eb333df69852bd4f6b307/lib/Doctrine/ORM/Query/SqlWalker.php#L777&quot; class=&quot;external-link&quot;&gt;here&lt;/a&gt;. This is actually the wrong place to append lock hints. This is generating the FROM clause like:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; FROM foo f0_ LEFT JOIN foo_bar f1_ ON f0_.id = f1_.foo_id LEFT JOIN bar b2_ ON f1_.bar_id = b2_.id WITH (NOLOCK)&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;When it should actually generate something like:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; FROM foo f0_ WITH (NOLOCK) LEFT JOIN foo_bar f1_ WITH (NOLOCK) ON f0_.id = f1_.foo_id LEFT JOIN bar b2_ WITH (NOLOCK) ON f1_.bar_id = b2_.id&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt; It should append lock hints after the table alias.&lt;/p&gt;

&lt;p&gt;I think the only reason this hasn&apos;t shown up before is that the other lock hint types haven&apos;t been applied in this way before, if at all.&lt;/p&gt;</description>
                <environment>SQL Server</environment>
            <key id="14513">DDC-2310</key>
            <summary>Recent changes to DBAL SQL Server platform lock hinting breaks ORM SqlWalker in DQL queries with joins</summary>
                <type id="1" iconUrl="http://www.doctrine-project.org/jira/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="2" iconUrl="http://www.doctrine-project.org/jira/images/icons/priorities/critical.png">Critical</priority>
                    <status id="5" iconUrl="http://www.doctrine-project.org/jira/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10000">All</security>
                        <assignee username="beberlei">Benjamin Eberlei</assignee>
                                <reporter username="wschalle">William Schaller</reporter>
                        <labels>
                        <label>dbal</label>
                        <label>lockhints</label>
                        <label>orm</label>
                        <label>sqlserver</label>
                        <label>sqlsrv</label>
                    </labels>
                <created>Thu, 21 Feb 2013 17:46:19 +0000</created>
                <updated>Thu, 21 Feb 2013 19:51:37 +0000</updated>
                    <resolved>Thu, 21 Feb 2013 18:04:07 +0000</resolved>
                            <version>Git Master</version>
                                <fixVersion>2.3.3</fixVersion>
                                <component>ORM</component>
                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="19583" author="stof" created="Thu, 21 Feb 2013 19:38:07 +0000"  >&lt;p&gt;I think the line appending the lock should be moved to &lt;a href=&quot;https://github.com/doctrine/doctrine2/blob/1bcda5147a890a8f419eb333df69852bd4f6b307/lib/Doctrine/ORM/Query/SqlWalker.php#L796&quot; class=&quot;external-link&quot;&gt;this place&lt;/a&gt; to achieve the result displayed above.&lt;/p&gt;

&lt;p&gt;But it may cause issues with some other vendor.&lt;/p&gt;</comment>
                    <comment id="19584" author="wschalle" created="Thu, 21 Feb 2013 19:51:26 +0000"  >&lt;p&gt;@Christophe I considered that too. None of the other platforms implement the appendLockHint function. None of the other platforms implement this because it is handled differently on other platforms &amp;#8211; with transaction isolation levels and such.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
        </item>
</channel>
</rss>