@Test(dependsOnMethods = "createSchema")
public void batch_cas() throws Exception {
PersistenceSession session = persistenceManager.createSession();
try {
Batch batch = session.startBatch();
try {
BatchCKEntity inst = new BatchCKEntity();
inst.setPk(1);
inst.setCk(1);
inst.setVal("1");
batch.insert(inst, PersistOption.ifNotExists());
inst = new BatchCKEntity();
inst.setPk(1);
inst.setCk(2);
inst.setVal("2");
batch.insert(inst);
inst = new BatchCKEntity();
inst.setPk(1);
inst.setCk(3);
inst.setVal("3");
batch.insert(inst, PersistOption.ifNotExists());
} finally { batch.close(); } // Batch.close() implicitly calls Batch.submitBatch()
BatchCKEntity loaded = session.loadOne(BatchCKEntity.class, 1, 1);
Assert.assertNotNull(loaded);
Assert.assertEquals(loaded.getVal(), "1");
loaded = session.loadOne(BatchCKEntity.class, 1, 2);