H
HalcyonWild
Hi,
I have read a lot about EJB. I have searched a lot on the Net for EJB
tutorials and EJB related guides and pages. Most of them begin at an
intermediate level. They talk about theory, without examples, even
trivial. Let us assume Stateless session beans for now.
This is what I have understood.
1. EJB are threadsafe components that run inside a container that
manages their lifecycle, their creation and destruction.
What does threadsafe mean here. I understand that for each request, a
separate EJB instance from the pool is assigned, which carries out
business logic.
Does it mean that two EJBs cannot modify the same record in a DB, at
same point of time. I dont think so they can, but I am not sure. Also,
will access to a common object(ie instance) be synchronized.
2. They say it does transaction management for you. What do we mean by
transaction management here. Transactions as in JDBC?. What if I am not
making any JDBC calls here. Is transaction management a feature of all
EJB or only Entity beans.
3. EJB takes care of security, transactions, multithreading, security
protocols, distributed programming, connection resource pooling, and so
on for you. (line pasted from a tutorial).
Connection pooling is done by dataSource in the App Server. How does
EJB do connection pooling.
Security - I understand that the EJB can be hosted on another server,
separate from the DB and the Web server. Is that the security which is
talked about.
Distributed programming - Isnt this what Servlets also do. I mean they
handle concurrent web requests. You can use simple java classes for
business logic, and servlets for redirection/delegation. How is EJB
useful here. Does it mean something like, 5 EJBs on one server, another
5 on second server, and so on.
You can point me to good resources which actually explain how EJB works
and in what scenarios it is useful. Most of the web pages or books I
have read, just give a few paragraphs about EJB advantages, and move
over to serious stuff.
Thanks
I have read a lot about EJB. I have searched a lot on the Net for EJB
tutorials and EJB related guides and pages. Most of them begin at an
intermediate level. They talk about theory, without examples, even
trivial. Let us assume Stateless session beans for now.
This is what I have understood.
1. EJB are threadsafe components that run inside a container that
manages their lifecycle, their creation and destruction.
What does threadsafe mean here. I understand that for each request, a
separate EJB instance from the pool is assigned, which carries out
business logic.
Does it mean that two EJBs cannot modify the same record in a DB, at
same point of time. I dont think so they can, but I am not sure. Also,
will access to a common object(ie instance) be synchronized.
2. They say it does transaction management for you. What do we mean by
transaction management here. Transactions as in JDBC?. What if I am not
making any JDBC calls here. Is transaction management a feature of all
EJB or only Entity beans.
3. EJB takes care of security, transactions, multithreading, security
protocols, distributed programming, connection resource pooling, and so
on for you. (line pasted from a tutorial).
Connection pooling is done by dataSource in the App Server. How does
EJB do connection pooling.
Security - I understand that the EJB can be hosted on another server,
separate from the DB and the Web server. Is that the security which is
talked about.
Distributed programming - Isnt this what Servlets also do. I mean they
handle concurrent web requests. You can use simple java classes for
business logic, and servlets for redirection/delegation. How is EJB
useful here. Does it mean something like, 5 EJBs on one server, another
5 on second server, and so on.
You can point me to good resources which actually explain how EJB works
and in what scenarios it is useful. Most of the web pages or books I
have read, just give a few paragraphs about EJB advantages, and move
over to serious stuff.
Thanks