Package com.vaadin.data.util.sqlcontainer

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


        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

    @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

    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

            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

        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

            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

        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

            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

        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

TOP

Related Classes of com.vaadin.data.util.sqlcontainer.OptimisticLockException

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.