简体   繁体   English

Spring中的EJB 3.0会话Bean等效于什么?

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

它像使用@Transactional方法创建POJO一样简单吗?

Yes, spring beans are pojos. 是的,四季豆就是波霍斯。 You have to declare it in applicationCotnext.xml or annotate it with @Service . 您必须在applicationCotnext.xml声明它或使用@Service对其进行注释。

在Spring中,将其创建为普通bean,然后指定会话范围@Scope批注。

Spring beans (ie properly declared) annotated with @Transactional are comparable to Local Session Beans. 带有@Transactional注释的Spring Bean(即正确声明的)与Local Session Bean相当。 For Remote Session Beans, you would have to add some remoting to your Spring configuration (RMI, Web Services, Hessian, Burlap, HTTP invokers). 对于远程会话Bean,您必须在Spring配置(RMI,Web服务,Hessian,Burlap,HTTP调用程序)中添加一些远程处理。 But Spring remoting does not support out of the box security and transaction propagation (unlike EJBs). 但是Spring远程处理不支持开箱即用的安全性和事务传播(与EJB不同)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM