• Post Reply Bookmark Topic Watch Topic
  • New Topic

Session Bean versus Java Class  RSS feed

 
ravi janap
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My application requirement is to design a search engine which queries the database given a search criteria and displays the results in a JSP. What is the advantage of using a Session Bean for database operations , over directly using a JDBC API to do database operations in a Java class?
 
Jun Hong
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The difference is huge. The session bean is in a container, which will do mutithreading, transaction control, security control, pooling, and others for you for free. If you have 100 clients to access the database the performance is a big issue. You java class cannot handle this as well as a session bean. Also, if it is a stateful session bean, it cache the state on server side and saves traffic.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!