Below is an example, how to configure it using annotation
@Begin(join=true,flushMode=FlushModeType.MANUAL)
public void methodWhereSomeThingStarts() {
public void methodWhereSomeThingStarts() {
and in the method that ends the conversation, we can use
@End
public void methodWhereBatchUpdateAndConversationCanEnd() {
//Iterating loop
em.flush();
public void methodWhereBatchUpdateAndConversationCanEnd() {
//Iterating loop
em.flush();
Note: em is javax.persistence.EntityManager