Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Selecting Exact EJb Type for my application  RSS feed

 
Sanjay Deshpande
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do i decide which type of ejb(session or entity)to use for which application?
 
Geeta Ramasami
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
This depends upon ur application.
If there is much of business logic involved which doesn't involve any persistant data, then go in for session bean.Here the session bean instance is not multithreaded.ie an EjbObject associated with the bean instance can serve only one client at a time.
Whereas the entity bean instance is multithreaded.An entitybean instance would be pointing to a row in the persistant storage.
The same instance could be used by multiple clients to use the same data.
If ur application involves lot of dataaccess and manipulation login its advisable to go in for entity beans bcos an instance allocated for a database entity is shared among the clients and also the container ensures that the integrity of the data is maintained throughout ur application whereever the database data is used for processing..
Cheers
Geeta
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!