java - In spring declarative transaction management when transaction commited -



java - In spring declarative transaction management when transaction commited -

as describe in question , transaction committed in spring desclarative transaction mangament. e.g suppose have next code

@service @transactional class customeraservice{ public void processcustomer(customer customer){ //call dao , insert client furtherprocesscustomer(customer customer); //last line (a) } @transactional(propagation=propagation.requires_new) public void furtherprocesscustomer(customer customer){ //call dao db work //last line (b) } }

suppose if stop execution @ line //last line (a) trasaction commited processcustomer() method. tried search on net didn't much information

the transaction management in spring occurs via aspect-oriented-programming (aop) proxy objects. means method must homecoming cleanly in order transaction committed. code "target method" in diagram below, while transactions committed in "transaction advisor". more documentation here.

your illustration kind of subtle since furtherprocesscustomer method called inside same class, not called via aop proxy object , hence @transactional(propagation=propagation.requires_new) not used.

if had service, @transactional annotations , called furtherprocesscustomer, occur via aop proxy object , hence have nested transaction.

java spring spring-mvc jdbc 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' -