Hi,
We are planning to use Session Beans
in our project. This leaves us with two options..
1. Write the sql queries inside the Session Bean.
Disadv:
If ur sql query changes by any chance..then u may have to re-deploy the bean.
2. Have a DAO which will have the sql queries and create & call it from the method of the session bean
Adv:
If the sql query changes just compile the DAO class.
Disadv(not sure):
The DAO object will be created whenever u call a method on the session bean which will mitigate the real use of
EJB (i.e) eventhough the session beans are pooled, since the no., of DAO's are created for each call, the DAO number will go on increasing as the number of calls. This is what my assumption goes.
Is there anyway to avoid this or is there any method of implementation?
Please clarify.
TIA,
Nijeesh.