Skip to content

Commit

Permalink
Prevent closeConnection() from throwing an occi::SQLException.
Browse files Browse the repository at this point in the history
This might happen if the connection was already invalidated on the
server, e.g., after a restart.
  • Loading branch information
johannish committed Aug 19, 2013
1 parent 7fd35fd commit a150b22
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,12 @@ Handle<Value> Connection::SetAutoCommit(const Arguments& args) {

void Connection::closeConnection() {
if(m_environment && m_connection) {
m_environment->terminateConnection(m_connection);
m_connection = NULL;
try {
m_environment->terminateConnection(m_connection);
m_connection = NULL;
} catch (oracle::occi::SQLException &ex) {
m_connection = NULL;
}
}
}

Expand Down

0 comments on commit a150b22

Please sign in to comment.