简体   繁体   中英

Spring Batch Transaction commit outside commit interval

I implemented a spring batch framework with reader, processor, writer. the batch framework initiates a transaction and commit interval is for every 50 records say.

Now within my reader or processor if i dont want to wait for some update or insert statement to wait until commit interval is reached, and want to commit right there is it possible?

It can re framed like how to commit only specific records before commit interval is reached in a spring batch transaction.

I am using ibatis, oracle11g. I tried to commit transactions from my ibatis SQL Template and couldnt see the commit happening.

You can achieve this using Requires New transaction propagation. This way you can commit some data changes no matter whether you commit or roll back the main transaction later.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM