Skip to content

Batch Mode

DuyHai DOAN edited this page Oct 29, 2015 · 17 revisions

Support for Batch

Achilles does not offer a direct support for CQL Batch. However it is extremely easy to generate a com.datastax.driver.core.BoundStatement using the Raw Statement Generation and add it to a com.datastax.driver.core.Batch instance yourself.

	final BatchStatement batch = new BatchStatement();
	
	BoundStatement insert = manager
		.crud()
		.insert(...)
		.generateAndGetBoundStatement();
		
	BoundStatement update = manager
		.dsl()
		.update()
		...
		.generateAndGetBoundStatement();
		
	batch.add(insert);	
	batch.add(update);
		
	manager.getNativeSession().execute(batch);	

Et voila !

Home

Clone this wiki locally