开发者

What is the equivalent of an EJB 3.0 Session Bean in Spring?

开发者 https://www.devze.com 2023-01-15 06:14 出处:网络
Is it as simple as creatin开发者_开发技巧g a POJO with @Transactional methods?Yes, spring beans are pojos. You have to declare it in applicationCotnext.xml or annotate it with @Service.In Spring you c

Is it as simple as creatin开发者_开发技巧g a POJO with @Transactional methods?


Yes, spring beans are pojos. You have to declare it in applicationCotnext.xml or annotate it with @Service.


In Spring you create it as normal bean and you specify session scope or @Scope annotation.


Spring beans (i.e. properly declared) annotated with @Transactional are comparable to Local Session Beans. For Remote Session Beans, you would have to add some remoting to your Spring configuration (RMI, Web Services, Hessian, Burlap, HTTP invokers). But Spring remoting does not support out of the box security and transaction propagation (unlike EJBs).

0

精彩评论

暂无评论...
验证码 换一张
取 消