Spring Declarative Transactions help needed -



Spring Declarative Transactions help needed -

i writing quartz job run on daily basis , update particular database table.

the logic same follows:

1) fetch entities [as using hibernate] needs , update 2) iterate them, each object , phone call separate private method perform update.

the above 2 steps performed within public method representing quartz job.

i want create sure if update of record fails, should not impact other records. example, if 50 records found , error occurs while updating 31st record should not rollback previous 30 updates.

can please suggest transaction methodology should used here? should propagation_not_supported or propagation_requires_new or other?

regards

using declarative transaction management private methods hard ... see http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/htmlsingle/#tx-decl-explained details.

for utilize case see 2 options:

use programmatic transaction management, if reads code obvious transaction boundaries are extract info access object persistence logic public update method (updates 1 entity). can utilize declarative approach dao.

the later approach helps separate concerns not having care transactions , database related code in quartz job.

spring spring-transactions

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -