Greg
Greg

Reputation: 785

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

Is it as simple as creating a POJO with @Transactional methods?

Upvotes: 2

Views: 1560

Answers (3)

Pascal Thivent
Pascal Thivent

Reputation: 570295

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).

Upvotes: 1

amra
amra

Reputation: 16875

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

Upvotes: 1

Bozho
Bozho

Reputation: 597016

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

Upvotes: 2

Related Questions