hi,
i m new to spring, and i faced this weird probleme,
my source code is as follow:
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void persisteRelationShip(int idp, int idv) {
Personne p = new Personne();
p.setIdpersonne(idp);
p.setLogin("p2");
p.setPasswd("p2");
personneDao.merge(p);
Velo v = new Velo();
v.setIdvelo(idv);
v.setNomVelo("VTT");
v.setPersonne(p);
veloDao.merge(v);
}
@Transactional
public void removeWithRelationShip(int idp, int idv) {
persisteRelationShip(idp, idv);
Personne p=personneDao.findById(idp);
p.setLogin("jaaaaaaaaaaao");
throw new RuntimeException();
}
I ve thrown intentionally an exception in the second method to prompt a rollback.
in a main when i call the second method (removeWithRelationShip), an exception is generated as expected, but surprisingly i don't find my person and velo in the database, isn't that normal.??? or it's me who didn't understand the "requires_new" propagation type. thank you in advance
NB: i use an eclipselink implementation for JPA, a LocalContainerEntityManagerFactoryBean with pooled datasource (dbcp), and a simple JPAtransactionManager, the underlying database is a Mysql DB.


Reply With Quote
i m so upset that noone's take the pain to put some tracks that i can follow, but any way i love U all
,
