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
d9b77d89
Commit
d9b77d89
authored
Nov 09, 2010
by
Miloslav Kmet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make transactions in OCI8 driver compatible with other drivers.
parent
fc28444a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
OCI8Connection.php
lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php
+6
-1
OCI8Statement.php
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
+4
-2
No files found.
lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php
View file @
d9b77d89
...
...
@@ -30,6 +30,8 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
{
private
$_dbh
;
protected
$_executeMode
=
OCI_COMMIT_ON_SUCCESS
;
public
function
__construct
(
$username
,
$password
,
$db
)
{
$this
->
_dbh
=
@
oci_connect
(
$username
,
$password
,
$db
);
...
...
@@ -40,7 +42,7 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
public
function
prepare
(
$prepareString
)
{
return
new
OCI8Statement
(
$this
->
_dbh
,
$prepareString
);
return
new
OCI8Statement
(
$this
->
_dbh
,
$prepareString
,
$this
->
_executeMode
);
}
public
function
query
()
...
...
@@ -72,6 +74,7 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
public
function
beginTransaction
()
{
$this
->
_executeMode
=
OCI_NO_AUTO_COMMIT
;
return
true
;
}
...
...
@@ -80,6 +83,7 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
if
(
!
oci_commit
(
$this
->
_dbh
))
{
throw
OCI8Exception
::
fromErrorInfo
(
$this
->
errorInfo
());
}
$this
->
_executeMode
=
OCI_COMMIT_ON_SUCCESS
;
return
true
;
}
...
...
@@ -88,6 +92,7 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
if
(
!
oci_rollback
(
$this
->
_dbh
))
{
throw
OCI8Exception
::
fromErrorInfo
(
$this
->
errorInfo
());
}
$this
->
_executeMode
=
OCI_COMMIT_ON_SUCCESS
;
return
true
;
}
...
...
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
View file @
d9b77d89
...
...
@@ -33,6 +33,7 @@ class OCI8Statement implements \Doctrine\DBAL\Driver\Statement
{
/** Statement handle. */
private
$_sth
;
private
$_executeMode
;
private
$_paramCounter
=
0
;
private
static
$_PARAM
=
':param'
;
private
static
$fetchStyleMap
=
array
(
...
...
@@ -48,9 +49,10 @@ class OCI8Statement implements \Doctrine\DBAL\Driver\Statement
* @param resource $dbh The connection handle.
* @param string $statement The SQL statement.
*/
public
function
__construct
(
$dbh
,
$statement
)
public
function
__construct
(
$dbh
,
$statement
,
$executeMode
)
{
$this
->
_sth
=
oci_parse
(
$dbh
,
$this
->
_convertPositionalToNamedPlaceholders
(
$statement
));
$this
->
_executeMode
=
$executeMode
;
}
/**
...
...
@@ -146,7 +148,7 @@ class OCI8Statement implements \Doctrine\DBAL\Driver\Statement
}
}
$ret
=
@
oci_execute
(
$this
->
_sth
,
OCI_DEFAULT
);
$ret
=
@
oci_execute
(
$this
->
_sth
,
$this
->
_executeMode
);
if
(
!
$ret
)
{
throw
OCI8Exception
::
fromErrorInfo
(
$this
->
errorInfo
());
}
...
...
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