Package org.apache.cayenne.testdo.locking

Examples of org.apache.cayenne.testdo.locking.SimpleLockingTestEntity


        List allObjects = context.performQuery(new SelectQuery(
                SimpleLockingTestEntity.class));
        assertEquals(1, allObjects.size());

        SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);

        // change description and save... no optimistic lock failure expected
        object.setDescription("first update");
        context.commitChanges();

        context.deleteObject(object);
        context.commitChanges();
    }
View Full Code Here


        List allObjects = context.performQuery(new SelectQuery(
                SimpleLockingTestEntity.class));
        assertEquals(1, allObjects.size());

        SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);

        // change description and save... no optimistic lock failure expected
        object.setDescription("first update");
        context.commitChanges();

        context.deleteObject(object);
        context.invalidateObjects(Collections.singletonList(object));
        context.commitChanges();
View Full Code Here

        List allObjects = context.performQuery(new SelectQuery(
                SimpleLockingTestEntity.class));
        assertEquals(1, allObjects.size());

        SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);

        // change description and save... no optimistic lock failure expected
        object.setDescription("first update");
        context.commitChanges();

        context.deleteObject(object);
        context.getObjectStore().getDataRowCache().forgetSnapshot(object.getObjectId());
        context.commitChanges();
    }
View Full Code Here

        List allObjects = context.performQuery(new SelectQuery(
                SimpleLockingTestEntity.class));
        assertEquals(1, allObjects.size());

        SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);

        // change description and save... no optimistic lock failure expected
        object.setDescription("first update");
        context.commitChanges();

        context.invalidateObjects(Collections.singletonList(object));
        context.deleteObject(object);
        context.commitChanges();
View Full Code Here

        List allObjects = context.performQuery(new SelectQuery(
                SimpleLockingTestEntity.class));
        assertEquals(1, allObjects.size());

        SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);

        // change description and save... no optimistic lock failure expected
        object.setDescription("first update");
        context.commitChanges();

        context.getObjectStore().getDataRowCache().forgetSnapshot(object.getObjectId());
        context.deleteObject(object);
        context.commitChanges();
    }
View Full Code Here

        List allObjects = context.performQuery(new SelectQuery(
                SimpleLockingTestEntity.class));
        assertEquals(1, allObjects.size());

        SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);

        // change description and save... no optimistic lock failure expected
        object.setDescription("second update");
        context.commitChanges();

        // change row underneath, delete and save... optimistic lock failure expected
        createTestData("SimpleLockUpdate");
View Full Code Here

        List allObjects = context.performQuery(new SelectQuery(
                SimpleLockingTestEntity.class));
        assertEquals(1, allObjects.size());

        SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);

        // change description and save... no optimistic lock failure expected
        object.setDescription("first update");
        context.commitChanges();

        object.setDescription("second update");

        context.commitChanges();
    }
View Full Code Here

        List allObjects = context.performQuery(new SelectQuery(
                SimpleLockingTestEntity.class));
        assertEquals(1, allObjects.size());

        SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);

        // change description and save... no optimistic lock failure expected
        object.setDescription("first update");
        context.commitChanges();

        object.setDescription("second update");
        context.invalidateObjects(Collections.singletonList(object));

        context.commitChanges();
    }
View Full Code Here

        List allObjects = context.performQuery(new SelectQuery(
                SimpleLockingTestEntity.class));
        assertEquals(1, allObjects.size());

        SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);

        // change description and save... no optimistic lock failure expected
        object.setDescription("first update");
        context.commitChanges();

        context.invalidateObjects(Collections.singletonList(object));
        object.setDescription("second update");

        context.commitChanges();
    }
View Full Code Here

        List allObjects = context.performQuery(new SelectQuery(
                SimpleLockingTestEntity.class));
        assertEquals(1, allObjects.size());

        SimpleLockingTestEntity object = (SimpleLockingTestEntity) allObjects.get(0);

        // change description and save... no optimistic lock failure expected
        object.setDescription("first update");
        context.commitChanges();

        object.setDescription("second update");
        context.getObjectStore().getDataRowCache().forgetSnapshot(object.getObjectId());

        context.commitChanges();
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.testdo.locking.SimpleLockingTestEntity

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.