Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

thread safty in EJB  RSS feed

 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Samanthi perera
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
then how we get persistance in EJB 3 ?
are you kidding?
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!