Skip to content

Mongo Batch Insert Update

chhavigangwal edited this page May 25, 2015 · 7 revisions

Batch insert/update is an important feature keeping NOSQL and performance in mind.

##Feature available

Along with MongoDB, this feature is also available for Cassandra and HBase from 2.1 onwards.

##How to use Persistence.xml: Modify persistence.xml to add a property:

<property name="kundera.batch.size" value="5000" />

You can configure value as required batch size.

Implicit flush: Based on configured value, Kundera will handle implicit flush upon reaching batch size value.

Explicit flush: You can flush explicitly, simply by invoking entitymanger.flush() method.

##Sample Example Please find this testcase.

Clone this wiki locally