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
3ea1f806
Commit
3ea1f806
authored
Jan 31, 2010
by
beberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] DDC-290 - Enhance OCI8 Error handling and convert errors to exceptions where necessary.
parent
8d607b1b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
4 deletions
+47
-4
OCI8Connection.php
lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php
+12
-3
OCI8Exception.php
lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php
+30
-0
OCI8Statement.php
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
+5
-1
No files found.
lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php
View file @
3ea1f806
...
...
@@ -32,7 +32,10 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
public
function
__construct
(
$username
,
$password
,
$db
)
{
$this
->
_dbh
=
oci_connect
(
$username
,
$password
,
$db
);
$this
->
_dbh
=
@
oci_connect
(
$username
,
$password
,
$db
);
if
(
!
$this
->
_dbh
)
{
throw
new
OCI8Exception
(
$this
->
errorInfo
());
}
}
public
function
prepare
(
$prepareString
)
...
...
@@ -74,12 +77,18 @@ class OCI8Connection implements \Doctrine\DBAL\Driver\Connection
public
function
commit
()
{
return
oci_commit
(
$this
->
_dbh
);
if
(
!
oci_commit
(
$this
->
_dbh
))
{
throw
OCI8Exception
::
fromErrorInfo
(
$this
->
errorInfo
());
}
return
true
;
}
public
function
rollBack
()
{
return
oci_rollback
(
$this
->
_dbh
);
if
(
!
oci_rollback
(
$this
->
_dbh
))
{
throw
OCI8Exception
::
fromErrorInfo
(
$this
->
errorInfo
());
}
return
true
;
}
public
function
errorCode
()
...
...
lib/Doctrine/DBAL/Driver/OCI8/OCI8Exception.php
0 → 100644
View file @
3ea1f806
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\DBAL\Driver\OCI8
;
class
OCI8Exception
extends
\Exception
{
static
public
function
fromErrorInfo
(
$error
)
{
return
new
self
(
$error
[
'message'
],
$error
[
'code'
]);
}
}
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
View file @
3ea1f806
...
...
@@ -137,7 +137,11 @@ class OCI8Statement implements \Doctrine\DBAL\Driver\Statement
}
}
return
oci_execute
(
$this
->
_sth
,
OCI_DEFAULT
);
$ret
=
@
oci_execute
(
$this
->
_sth
,
OCI_DEFAULT
);
if
(
!
$ret
)
{
throw
OCI8Exception
::
fromErrorInfo
(
$this
->
errorInfo
());
}
return
$ret
;
}
/**
...
...
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