A conference has many calls. The following codes move a call (id:6578) from one conference (id:6821) to another conference(id:7474).
Code:
@Transactional(propagation=Propagation.REQUIRED,isolation=Isolation.DEFAULT)
public void moveCall(String command) {
String[] args = command.split( " " ) ;
long callid = Long.valueOf( args[1] ) ;
long confid = Long.valueOf( args[2] ) ;
McpConference conf = confDao.find( confid ) ;
McpCallLeg call = confDao.findCall(callid) ;
call.setConference( conf ) ;
conf.addCallLeg( call ) ;
}
After the above method executed, the data in the database changed correctly, but when I call the entityManager.find() to list the conent of the two conferneces in another transaction (another method), I find that the call (id:6578) listed in the two conference.
What is wrong in my code?
I used EhCacheProvider in this application. J2SE, JDK 1.5, Hibernate 3.2.1, Spingframework 2.0.1
Thanks for your help very much!
BTW, I want to buy a eBook of "Java Persistence with Hibernate", but the above link on the page can not be accessed, where is the eBook?