mardi 14 avril 2015

EJB3 Transaction management vs Spring Transaction management

Can anyone tell me if there are any essential differences in transaction management between Spring and EJB3? For example, we have two beans:



@Stateless
class BeanBImpl implements BeanB {

methodB(){
...
}
}
@Stateless
class BeanAImpl implements BeanA {

@EJB
BeanB beanB;

methodA(){
...
beanB.methodB();
...
}
}


Now, I know that when methodA() will be executed, by default EJB container will "share" transaction between methodA() and methodB() so that if rollback will ocure, changes from both methods will be rollbacked. However, does the Spirng provides the same functionality? Moreover, does the exception handling work the same in both containers? Are there any other releven differences?


Aucun commentaire:

Enregistrer un commentaire