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
088e70f1
Commit
088e70f1
authored
Jun 07, 2006
by
doctrine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small typo fix
parent
10d6a8ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
Pessimistic.php
Doctrine/Locking/Manager/Pessimistic.php
+7
-7
No files found.
Doctrine/Locking/Manager/Pessimistic.php
View file @
088e70f1
...
@@ -20,7 +20,7 @@ class Doctrine_Locking_Manager_Pessimistic
...
@@ -20,7 +20,7 @@ class Doctrine_Locking_Manager_Pessimistic
/**
/**
* The database table name for the lock tracking
* The database table name for the lock tracking
*/
*/
private
$lockTable
=
'doctrine_lock_tracking'
;
private
$
_
lockTable
=
'doctrine_lock_tracking'
;
/**
/**
* Constructs a new locking manager object
* Constructs a new locking manager object
...
@@ -43,7 +43,7 @@ class Doctrine_Locking_Manager_Pessimistic
...
@@ -43,7 +43,7 @@ class Doctrine_Locking_Manager_Pessimistic
$columns
[
'timestamp_obtained'
]
=
array
(
'integer'
,
10
,
'notnull'
);
$columns
[
'timestamp_obtained'
]
=
array
(
'integer'
,
10
,
'notnull'
);
$dataDict
=
new
Doctrine_DataDict
(
$this
->
_dataSource
->
getDBH
());
$dataDict
=
new
Doctrine_DataDict
(
$this
->
_dataSource
->
getDBH
());
$dataDict
->
createTable
(
$this
->
lockTable
,
$columns
);
$dataDict
->
createTable
(
$this
->
_
lockTable
,
$columns
);
}
}
}
}
...
@@ -75,7 +75,7 @@ class Doctrine_Locking_Manager_Pessimistic
...
@@ -75,7 +75,7 @@ class Doctrine_Locking_Manager_Pessimistic
$dbh
=
$this
->
_dataSource
->
getDBH
();
$dbh
=
$this
->
_dataSource
->
getDBH
();
$dbh
->
beginTransaction
();
$dbh
->
beginTransaction
();
$stmt
=
$dbh
->
prepare
(
"INSERT INTO
$this->lockTable
$stmt
=
$dbh
->
prepare
(
"INSERT INTO
$this->
_
lockTable
(object_type, object_key, user_ident, timestamp_obtained)
(object_type, object_key, user_ident, timestamp_obtained)
VALUES (:object_type, :object_key, :user_ident, :ts_obtained)"
);
VALUES (:object_type, :object_key, :user_ident, :ts_obtained)"
);
$stmt
->
bindParam
(
':object_type'
,
$objectType
);
$stmt
->
bindParam
(
':object_type'
,
$objectType
);
...
@@ -97,7 +97,7 @@ class Doctrine_Locking_Manager_Pessimistic
...
@@ -97,7 +97,7 @@ class Doctrine_Locking_Manager_Pessimistic
{
{
$gotLock
=
true
;
// The requesting user already has a lock
$gotLock
=
true
;
// The requesting user already has a lock
// Update timestamp
// Update timestamp
$stmt
=
$dbh
->
prepare
(
"UPDATE
$this->lockTable
SET timestamp_obtained = :ts
$stmt
=
$dbh
->
prepare
(
"UPDATE
$this->
_
lockTable
SET timestamp_obtained = :ts
WHERE object_type = :object_type AND
WHERE object_type = :object_type AND
object_key = :object_key AND
object_key = :object_key AND
user_ident = :user_ident"
);
user_ident = :user_ident"
);
...
@@ -143,7 +143,7 @@ class Doctrine_Locking_Manager_Pessimistic
...
@@ -143,7 +143,7 @@ class Doctrine_Locking_Manager_Pessimistic
try
try
{
{
$dbh
=
$this
->
_dataSource
->
getDBH
();
$dbh
=
$this
->
_dataSource
->
getDBH
();
$stmt
=
$dbh
->
prepare
(
"DELETE FROM
$this->lockTable
WHERE
$stmt
=
$dbh
->
prepare
(
"DELETE FROM
$this->
_
lockTable
WHERE
object_type = :object_type AND
object_type = :object_type AND
object_key = :object_key AND
object_key = :object_key AND
user_ident = :user_ident"
);
user_ident = :user_ident"
);
...
@@ -183,7 +183,7 @@ class Doctrine_Locking_Manager_Pessimistic
...
@@ -183,7 +183,7 @@ class Doctrine_Locking_Manager_Pessimistic
{
{
$dbh
=
$this
->
_dataSource
->
getDBH
();
$dbh
=
$this
->
_dataSource
->
getDBH
();
$stmt
=
$dbh
->
prepare
(
"SELECT user_ident
$stmt
=
$dbh
->
prepare
(
"SELECT user_ident
FROM
$this->lockTable
FROM
$this->
_
lockTable
WHERE object_type = :object_type AND object_key = :object_key"
);
WHERE object_type = :object_type AND object_key = :object_key"
);
$stmt
->
bindParam
(
':object_type'
,
$objectType
);
$stmt
->
bindParam
(
':object_type'
,
$objectType
);
$stmt
->
bindParam
(
':object_key'
,
$key
);
$stmt
->
bindParam
(
':object_key'
,
$key
);
...
@@ -220,7 +220,7 @@ class Doctrine_Locking_Manager_Pessimistic
...
@@ -220,7 +220,7 @@ class Doctrine_Locking_Manager_Pessimistic
try
try
{
{
$dbh
=
$this
->
_dataSource
->
getDBH
();
$dbh
=
$this
->
_dataSource
->
getDBH
();
$stmt
=
$dbh
->
prepare
(
"DELETE FROM
$this->lockTable
WHERE timestamp_obtained < :age"
);
$stmt
=
$dbh
->
prepare
(
"DELETE FROM
$this->
_
lockTable
WHERE timestamp_obtained < :age"
);
$stmt
->
bindParam
(
':age'
,
$age
);
$stmt
->
bindParam
(
':age'
,
$age
);
$stmt
->
execute
();
$stmt
->
execute
();
...
...
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