when we need access to database tables in our business logic, we use a dao in the stateless session bean containing the business logic instead of creating an entity bean and having the stateless session bean access the entity bean. when would an entity bean be the prefered solution? what are the advantages of using them instead of a dao in a slsb?
I think with EJB 2.0, entity beans are becoming more popular because many of the performance problems have been solved. As Prashanth noted, they are more inline with using declarative services such as persistence and transactions.
Hi all, I originally wrote most of my DAOs using Stateless session beans. However, even with the release of the EJB 2.0 spec, for most of the work I do I find a lot of the OS OR mapping tools like Torque or OJB are just too darn easy to use? What are your opinions? :,>
John Carnell - Senior Engineer, Genesys PureCloud Division
Author of Spring Microservices in Action
i too prefer slsb --> dao instead of slsb --> entity bean --> dao what are the effects on performance and scaleability? would the entity bean solution have better performance and scaleability? are there any articles or whitepapers discussing the tradeoffs?
posted 16 years ago
I think the entity bean camp argues now to slsb --> entity bean (CMP) instead of slsb --> dao or slsb --> entity bean (BMP) --> dao The CMP entity beans will be clustered by most containers so the scalability might be higher with them (although since it is recommended to use a session facade with local references I'm not really sure how this pans out). I don't see any general performance rationale, the benchmark would probably depend upon how well the container vendor implements the CMP. [ October 06, 2002: Message edited by: Jim Baiter ]