File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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: 6720

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: 6720

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
 
Threads others viewed
Program like ATM where person enters amount in dollars and cents but program uses int for monies
Banking with Threads
How to store state in statefull session bean
Having trouble understanding an error code i keep getting. Please help!
Bank account simulation
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com