File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why EJB ?

 
Malli Raman
Ranch Hand
Posts: 312
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I would like to clear my doubts about the usage of EJB in the J2EE application.

When to use EJB instead of servlets + javabeans + jdbc api? In my application which contains normal transactions (view/modify/delete, 10000 users + assumming max 100 users doing concurrent transaction), I have used the MVC architecture and deployed in weblogic app server and the application is currently running fine with out any problem.

What will happen if we replace the javabeans + jdbc api with EJB? Do the performance will improve? ( I have read that using Entity beans will affect the performance? Or making the servlet as a controller and put the business logic in the session bean just to differentiate control logic from bus logic.)

I read that EJB means for transactions, security, distributed computing and no need to be expert in SQL Language, But I think we will use the same transaction code in both cases as we are getting the connection from Connection pool(Assuming that I am not changing the transaction parameter in the deployment descriptor!!). Except the security and distributed computing do we need to use the EJB if the developer is well verse in SQL Coding?

In our application we are using our own security mechanism to authenticate & Authorize the users. I am using the servlets + javabeans for distributed computing. So why EJB?

Thanks & Regards,
M.S.Raman
 
Malli Raman
Ranch Hand
Posts: 312
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone suggests a better idea for using ejb's.
 
Francis Shillitoe
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The choice to use EJBs or not shouldn't really be based on your team's SQL knowledge. The decision to use EJBs should be based on whether the following services are required:

- Transaction support
- Management of multiple instances (pooling)
- Persistence support
- Security support
- Multithreading support
- Synchronisation

The excellent book "Mastering Enterpise Jave Beans" can be downloaded FREE from:

http://www.theserverside.com/books/wiley/masteringEJB/index.tss

Francis
 
Rohit Ahuja
Ranch Hand
Posts: 121
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Malli,
Simply put i do not think ur project currently needs EJBs. People in India have a misconception that EJBs make things faster and use it where their existance is literally not needed. Moral of the story. if ur app is currently working fine dont try to do something funny with it and mess it up. 100 concurrent users can be handled by simple beans.No need of EJBs.
 
Malli Raman
Ranch Hand
Posts: 312
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Francis Shillitoe:

- Transaction support
- Management of multiple instances (pooling)
- Persistence support
- Security support
- Multithreading support
- Synchronisation



Thanks Francis,John for replying my query.

I think EJB can be used when the no of concurrent transaction is more, where you don't want to use multi threading(Container only can implement the multithreading).
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic