Package org.lealone.message

Examples of org.lealone.message.DbException


    public void replace(String querySQL, String[] columnNames, Session session, boolean recursive, boolean force) {
        String oldQuerySQL = this.querySQL;
        String[] oldColumnNames = this.columnNames;
        boolean oldRecursive = this.recursive;
        init(querySQL, null, columnNames, session, recursive);
        DbException e = recompile(session, force);
        if (e != null) {
            init(oldQuerySQL, null, oldColumnNames, session, oldRecursive);
            recompile(session, true);
            throw e;
        }
View Full Code Here


        SynchronizedVerifier.check(indexCache);
        indexCache.clear();
        initColumnsAndTables(session);
        if (views != null) {
            for (TableView v : views) {
                DbException e = v.recompile(session, force);
                if (e != null && !force) {
                    return e;
                }
            }
        }
View Full Code Here

                    return prepared.query(maxrows.intValue());
            } catch (Throwable t) {
                if (t instanceof DoNotRetryIOException) {
                    throw DbException.convert(t);
                } else if (t instanceof DbException) {
                    DbException dbe = (DbException) t;
                    if (dbe.getCause() instanceof JdbcSQLException) {
                        if (((JdbcSQLException) dbe.getCause()).getCause() instanceof DoNotRetryIOException) {
                            throw dbe;
                        }
                    }
                    if (dbe.getErrorCode() != ErrorCode.IO_EXCEPTION_1)
                        throw dbe;
                } else if (t instanceof RuntimeException) {
                    if (((RuntimeException) t).getCause() instanceof DoNotRetryIOException) {
                        throw ((RuntimeException) t);
                    }
View Full Code Here

                // but if that is not the case it means there is something wrong
                // with the database
                trace.error(e2, "could not undo operation");
                throw e2;
            }
            DbException de = DbException.convert(e);
            if (de.getErrorCode() == ErrorCode.DUPLICATE_KEY_1) {
                for (int j = 0; j < indexes.size(); j++) {
                    Index index = indexes.get(j);
                    if (index.getIndexType().isUnique() && index instanceof MultiVersionIndex) {
                        MultiVersionIndex mv = (MultiVersionIndex) index;
                        if (mv.isUncommittedFromOtherSession(session, row)) {
View Full Code Here

            if (sessionFactory == null) {
                sessionFactory = ci.getSessionFactory();
            }
            return sessionFactory.createSession(ci);
        } catch (Exception re) {
            DbException e = DbException.convert(re);
            if (e.getErrorCode() == ErrorCode.DATABASE_ALREADY_OPEN_1) {
                if (autoServerMode) {
                    String serverKey = ((JdbcSQLException) e.getSQLException()).getSQL();
                    if (serverKey != null) {
                        backup.setServerKey(serverKey);
                        // OPEN_NEW must be removed now, otherwise
                        // opening a session with AUTO_SERVER fails
                        // if another connection is already open
View Full Code Here

     *
     * @return the exception
     */
    protected DbException getDuplicateKeyException() {
        String sql = getName() + " ON " + table.getSQL() + "(" + getColumnListSQL() + ")";
        DbException e = DbException.get(ErrorCode.DUPLICATE_KEY_1, sql);
        e.setSource(this);
        return e;
    }
View Full Code Here

    }

    public int update() {
        session.commit(true);
        session.getUser().checkRight(view, Right.ALL);
        DbException e = view.recompile(session, false);
        if (e != null) {
            throw e;
        }
        return 0;
    }
View Full Code Here

TOP

Related Classes of org.lealone.message.DbException

Copyright © 2018 www.massapicom. 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.