EJB vs Hibernate
April 16th, 2004
The world has become a weird place: during last JavaPolis, I heard Floyd Marinescu say "Alternatives to EJB are rising. They might be a better solution for you." Today, I read Gavin King saying "EJB's are not that bad after all." What's next? World peace?
5 Responses to “EJB vs Hibernate”
Sorry, comments are closed for this article.

April 21st, 2008 at 10:17 PM To be honest he was talking about one type of EJB - stateful session beans. Most people who have problems with EJB's really have issues with Entity beans - I am still a big fan of stateless session beans and message driven beans, but have yet to be convinced by the use of stateful session beans.
April 21st, 2008 at 10:17 PM Sam, I agree with you. I don't see many reasons for statefull session beans. It's always easier to scale stateless system. I don't even use Message driven beans, 'cause raw JMS is very easy to use and it gives me all that I need. I don't need clustering. I simply scale middle tier with cheap PCs with some load balancer in front of them. This strategy works with other technologies as well, eg. PHP, .NET, ... If I need to scale backend, then I might build db cluster with db provider's proprietary solution. No need for Application Servers (I don't count Apache, Tomcat etc. as application servers).
April 21st, 2008 at 10:17 PM We used Entity beans and Stateful session beans in one of our projects. It was a big mistake as it gave resource problems and transaction and timeout problems. So we took out stateful session bean and reduced the number of entity beans. Now it has been more stable. I would recommend not using entity beans and statefull session beans at all.
April 21st, 2008 at 10:17 PM tomk.....Floyd Marinescu said it's an alternative to EJB.....and not replacement for EJB
April 21st, 2008 at 10:17 PM Ken: eh... I thought that's what the post is saying?