Examples of DatabaseException


Examples of org.eclipse.persistence.exceptions.DatabaseException

                    // Allow for caching of statement, forced closes are not cache as they failed execution so are most likely bad.
                    DatabaseAccessor.this.releaseStatement(statement, dbCall.getSQLString(), dbCall, session);
                } catch (SQLException exception) {
                    //With an external connection pool the connection may be null after this call, if it is we will
                    //be unable to determine if it is a connection based exception so treat it as if it wasn't.
                    DatabaseException commException = processExceptionForCommError(session, exception, dbCall);
                    if (commException != null) results.throwException(commException);
                    results.throwException(DatabaseException.sqlException(exception, DatabaseAccessor.this, session, false));
                }
                results.setIsComplete(true);
            }
View Full Code Here

Examples of org.eclipse.persistence.exceptions.DatabaseException

            if ((!getPlatform().supportsAutoCommit()) && (!this.isInTransaction)) {
                getPlatform().autoCommit(this);
            }
        } catch (SQLException exception) {
            if (!getPlatform().shouldIgnoreException(exception)) {
                DatabaseException commException = processExceptionForCommError(session, exception, call);
                if (commException != null) throw commException;
                throw DatabaseException.sqlException(exception, this, session, false);
            }
        } finally {
            if (call != null) {
View Full Code Here

Examples of org.eclipse.persistence.exceptions.DatabaseException

        } catch (SQLException exception) {
            //If this is a connection from an external pool then closeStatement will close the connection.
            //we must test the connection before that happens.
            RuntimeException exceptionToThrow = null;
           
            DatabaseException commException = processExceptionForCommError(session, exception, dbCall);
            if (commException != null) throw commException;
            try {// Ensure that the statement is closed, but still ensure that the real exception is thrown.
                closeStatement(statement, session, dbCall);
            } catch (SQLException closeException) {
            }
            if (exceptionToThrow == null){
                throw DatabaseException.sqlException(exception, this, session, false);
            }
            throw exceptionToThrow;
        } catch (RuntimeException exception) {
            try {// Ensure that the statement is closed, but still ensure that the real exception is thrown.
                closeStatement(statement, session, dbCall);
            } catch (SQLException closeException) {
            }

            throw exception;
        }

        // This is in a separate try block to ensure that the real exception is not masked by the close exception.
        try {
            // if we are called from the ParameterizedBatchWritingMechanism then dbCall will not be null
            //and we should try an release the statement
            if (dbCall != null) {
                releaseStatement(statement, dbCall.getSQLString(), dbCall, session);
            } else {
                closeStatement(statement, session, dbCall);
            }
        } catch (SQLException exception) {
            DatabaseException commException = processExceptionForCommError(session, exception, dbCall);
            if (commException != null) throw commException;
            throw DatabaseException.sqlException(exception, this, session, false);
        }
        return returnValue;
    }
View Full Code Here

Examples of org.eclipse.persistence.exceptions.DatabaseException

                if (resultSet != null) {
                    resultSet.close();
                }
            } catch (SQLException closeException) {
            }
            DatabaseException commException = processExceptionForCommError(session, sqlException, null);
            if (commException != null) throw commException;
            // Ensure that real exception is thrown.     
            throw DatabaseException.sqlException(sqlException, this, session, false);
        } finally {
            decrementCallCount();
View Full Code Here

Examples of org.eclipse.persistence.exceptions.DatabaseException

            // PERF: Avoid wasNull check, null is return from the get call for nullable classes.
            if ((!optimizeData) && resultSet.wasNull()) {
                value = null;
            }
        } catch (SQLException exception) {
            DatabaseException commException = processExceptionForCommError(session, exception, null);
            if (commException != null) throw commException;
            throw DatabaseException.sqlException(exception, this, session, false);
        }

        return value;
View Full Code Here

Examples of org.eclipse.persistence.exceptions.DatabaseException

                if (resultSet != null) {
                    resultSet.close();
                }
            } catch (SQLException closeException) {
            }
            DatabaseException commException = processExceptionForCommError(session, sqlException, null);
            if (commException != null) throw commException;
            // Ensure that real exception is thrown.     
            throw DatabaseException.sqlException(sqlException, this, session, false);
        } finally {
            decrementCallCount();
View Full Code Here

Examples of org.eclipse.persistence.exceptions.DatabaseException

                getConnection().setAutoCommit(true);
            } else {
                getPlatform().rollbackTransaction(this);
            }
        } catch (SQLException exception) {
            DatabaseException commException = processExceptionForCommError(session, exception, null);
            if (commException != null) throw commException;
            throw DatabaseException.sqlException(exception, this, session, false);
        }
    }
View Full Code Here

Examples of org.exist.fluent.DatabaseException

  protected static Database db;
   
  @Before public void startupDatabase() throws Exception {
    ConfigFile configFileAnnotation = getClass().getAnnotation(ConfigFile.class);
    if (configFileAnnotation == null)
      throw new DatabaseException("Missing ConfigFile annotation on DatabaseTestCase subclass");
    File configFile = new File(configFileAnnotation.value());
    if (!Database.isStarted()) {
      Database.startup(configFile);
      db = null;
    }
View Full Code Here

Examples of org.glite.ce.commonj.db.DatabaseException

            updatePreparedStatement.executeUpdate();
            connection.commit();
            logger.info("set startUpTime in the database");
        } catch (Exception e) {
            logger.warn("Problem to update the startUpTime in the database");
            throw new DatabaseException("Problem to update the startUpTime in the database");
        } finally {
            if (updatePreparedStatement != null) {
                try {
                    updatePreparedStatement.close();
                } catch (SQLException sqle1) {
View Full Code Here

Examples of org.helidb.lang.DatabaseException

        break;
      }

      if (recordLen < 1L)
      {
        throw new DatabaseException("Invalid record length " + recordLen + " at position " + curPos);
      }
      curPos += recordLen;
      if (curPos > fileLen)
      {
        // An incomplete last entry. If the database crashed while
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.