The moose likes EJB and Other Java EE Technologies and the fly likes thread safty in EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » EJB and Other Java EE Technologies
Reply Bookmark "thread safty in EJB" Watch "thread safty in EJB" New topic
Author

thread safty in EJB

Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
I read that sessionbean and MDBs are thread safe in EJB.
so look example sessionbean below



1)so that means all methods in this session bean are thread safe?

2)why isn't Entity beans thread safe?
Jaikiran Pai
Saloon Keeper

Joined: Jul 20, 2005
Posts: 6561

Samanthi perera wrote:

1)so that means all methods in this session bean are thread safe?

Yes

Samanthi perera wrote:
2)why isn't Entity beans thread safe?

The example you posted is for EJB3. And EJB3 does not have any entity beans.


[My Blog] [JavaRanch Journal]
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
then how we get persistance in EJB 3 ?
are you kidding?
Jaikiran Pai
Saloon Keeper

Joined: Jul 20, 2005
Posts: 6561

Samanthi perera wrote:then how we get persistance in EJB 3 ?

You use plain JPA (or vendor specific) entities. JPA based entities are not enterprise beans. They are just plain java objects.

Samanthi perera wrote:
are you kidding?

No, I am not.
 
 
subject: thread safty in EJB
 
developer file tools