Examples of OptimisticLockException


Examples of com.vaadin.addon.sqlcontainer.OptimisticLockException

            setVersionColumnFlagInProperty(row);
            sh = sqlGenerator.generateUpdateQuery(tableName, row);
            result = executeUpdate(sh);
        }
        if (versionColumn != null && result == 0) {
            throw new OptimisticLockException(
                    "Someone else changed the row that was being updated.",
                    row.getId());
        }
        return result;
    }
View Full Code Here

Examples of com.vaadin.addon.sqlcontainer.OptimisticLockException

        debug("Removing row with id: " + row.getId().getId()[0].toString());
        if (executeUpdate(sqlGenerator.generateDeleteQuery(getTableName(), row)) == 1) {
            return true;
        }
        if (versionColumn != null) {
            throw new OptimisticLockException(
                    "Someone else changed the row that was being deleted.",
                    row.getId());
        }
        return false;
    }
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.OptimisticLockException

            setVersionColumnFlagInProperty(row);
            sh = sqlGenerator.generateUpdateQuery(getFullTableName(), row);
            result = executeUpdate(sh);
        }
        if (versionColumn != null && result == 0) {
            throw new OptimisticLockException(
                    "Someone else changed the row that was being updated.",
                    row.getId());
        }
        return result;
    }
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.OptimisticLockException

        if (executeUpdate(sqlGenerator.generateDeleteQuery(getFullTableName(),
                primaryKeyColumns, versionColumn, row)) == 1) {
            return true;
        }
        if (versionColumn != null) {
            throw new OptimisticLockException(
                    "Someone else changed the row that was being deleted.",
                    row.getId());
        }
        return false;
    }
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.OptimisticLockException

    @Test(expected = OptimisticLockException.class)
    public void storeRow_versionSetAndLessThanDBValue_shouldThrowException()
            throws SQLException {
        if (SQLTestsConstants.db == DB.HSQLDB) {
            throw new OptimisticLockException(
                    "HSQLDB doesn't support row versioning for optimistic locking - don't run this test.",
                    null);
        }
        DataGenerator.addVersionedData(connectionPool);
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.OptimisticLockException

    public void removeRow_versionSetAndLessThanDBValue_shouldThrowException()
            throws SQLException {
        if (SQLTestsConstants.db == SQLTestsConstants.DB.HSQLDB) {
            // HSQLDB doesn't support versioning, so this is to make the test
            // green.
            throw new OptimisticLockException(null);
        }
        DataGenerator.addVersionedData(connectionPool);

        TableQuery tQuery = new TableQuery("versioned", connectionPool,
                SQLTestsConstants.sqlGen);
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.OptimisticLockException

            setVersionColumnFlagInProperty(row);
            sh = sqlGenerator.generateUpdateQuery(tableName, row);
            result = executeUpdate(sh);
        }
        if (versionColumn != null && result == 0) {
            throw new OptimisticLockException(
                    "Someone else changed the row that was being updated.",
                    row.getId());
        }
        return result;
    }
View Full Code Here

Examples of com.vaadin.data.util.sqlcontainer.OptimisticLockException

        if (executeUpdate(sqlGenerator.generateDeleteQuery(getTableName(),
                primaryKeyColumns, versionColumn, row)) == 1) {
            return true;
        }
        if (versionColumn != null) {
            throw new OptimisticLockException(
                    "Someone else changed the row that was being deleted.",
                    row.getId());
        }
        return false;
    }
View Full Code Here

Examples of javax.persistence.OptimisticLockException

        }
        else if (jdoe instanceof JDOOptimisticVerificationException)
        {
            if (jdoe.getNestedExceptions() != null)
            {
                return new OptimisticLockException(jdoe.getMessage(), jdoe.getCause());
            }
            else
            {
                return new OptimisticLockException(jdoe.getMessage(), jdoe);
            }
        }
        else
        {
            // JPA doesnt have "internal" exceptions so just give a PersistenceException
View Full Code Here

Examples of javax.persistence.OptimisticLockException

        }
        else if (jpe instanceof JPOXOptimisticException)
        {
            if (jpe.getNestedExceptions() != null)
            {
                return new OptimisticLockException(jpe.getMessage(), jpe.getCause());
            }
            else
            {
                return new OptimisticLockException(jpe.getMessage(), jpe);
            }
        }
        else
        {
            // JPA doesnt have "internal" exceptions so just give a PersistenceException
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.