Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
02ea5f03
Commit
02ea5f03
authored
Feb 03, 2013
by
Guilherme Blanco
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #257 from deeky666/fix-sqlserverplatform-lockhints
fix SQLServerPlatform locking hints
parents
68a4633e
c9b1dc1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
SQLServerPlatform.php
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
+16
-10
No files found.
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
View file @
02ea5f03
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
namespace
Doctrine\DBAL\Platforms
;
namespace
Doctrine\DBAL\Platforms
;
use
Doctrine\DBAL\LockMode
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\DBALException
;
use
Doctrine\DBAL\DBALException
;
use
Doctrine\DBAL\Schema\ForeignKeyConstraint
;
use
Doctrine\DBAL\Schema\ForeignKeyConstraint
;
...
@@ -872,16 +873,21 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -872,16 +873,21 @@ class SQLServerPlatform extends AbstractPlatform
*/
*/
public
function
appendLockHint
(
$fromClause
,
$lockMode
)
public
function
appendLockHint
(
$fromClause
,
$lockMode
)
{
{
// @todo correct
switch
(
$lockMode
)
{
if
(
$lockMode
==
\Doctrine\DBAL\LockMode
::
PESSIMISTIC_READ
)
{
case
LockMode
::
NONE
:
return
$fromClause
.
' WITH (tablockx)'
;
$lockClause
=
' WITH (NOLOCK)'
;
}
break
;
case
LockMode
::
PESSIMISTIC_READ
:
if
(
$lockMode
==
\Doctrine\DBAL\LockMode
::
PESSIMISTIC_WRITE
)
{
$lockClause
=
' WITH (HOLDLOCK, ROWLOCK)'
;
return
$fromClause
.
' WITH (tablockx)'
;
break
;
}
case
LockMode
::
PESSIMISTIC_WRITE
:
$lockClause
=
' WITH (UPDLOCK, ROWLOCK)'
;
return
$fromClause
;
break
;
default
:
$lockClause
=
''
;
}
return
$fromClause
.
$lockClause
;
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment