• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

thread safty in EJB

 
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?
 
Sheriff
Posts: 10445
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: 10445
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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!