java - Problems with rollback and @Transactional -


i have following situation.

assume have 2 @services classes, inside each 1 have method annotated @transactinal.

the method of first class @transactional , calls method of second class (in second class, method annotated @transactiona(propagation=propagation.required)).

public class class1 {     @autowired     private class2 class2;     @transactional     public void dosomework(object value){         dao.save(value)         object anothervalue = value.getanothervalue();         anotherobject anotherobject = new anotherobject();         anotherobject.setvalue1("lorem ip");         anotherobject.setanothervalue(anothervalue);         class2.dosomework(anotherobject)     } }  @service public class class2{     @transactional(propagation=propagation.required)     public void dosomework(){         ...         throws new runtimeexception("fail");     } } 

i have observed value (the object in first method) rollback, but, have database id , in session cache.

i'm figuring out how remove object session or how evict this...

any sugestions?


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -