Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

BMP and CMP a Arch. mistake?

 
Ranch Hand
Posts: 420
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've heard two public speakers (Roger Sessions and David Chappell at the recent softpro presentation) explain that Bean Managed Persistance and Container Managed Persistance as well as statefull session beans are an architectual mistake.
Both these speakers say Microsoft did it correctly with COM+ where the only option is (in EJB terminology) a stateless session bean.
David explained the reason CMP and BMP are mistakes are that EJB has to continually look for inconsistancies between what is stored in the database and the state of the EJB.
Is this true? Does anyone have any references? Who is using stateful session beans, CMP or BMP? Is this problem of maintaining state a problem as they say?
Siegfried
 
Saloon Keeper
Posts: 22282
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"We don't have it, so it must not be any good", eh?
There is an expense to statefull session beans and to Entity beans, but if what you're doing is worth the cost, the expense is more than made up by having a debugged standardized framework to work in.
In the case of Entity beans, one of the benefits is having the data cached within the scope of the server where it can be rapidly retrieved, assuming that your access needs are a good fit for caching. Yes, it is dangerous if there are other updaters to a table outside the EJB system, BUT THE SAME IS TRUE OF COM+. OS/2 taught me well that one should have ONE and ONLY ONE authoritative place for keeping and changing data. And just as with COM+, non-web applications can choose to use an EJB for their data access mechanism to make that be the case.
 
Author
Posts: 350
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
People are using EJB CMP/CMR.
I don't feel it is an architectural mistake.
CMP/CMR and EJB QL makes EJB more useful.
Check out this posting...
EJB is useful and getting even more so!

CMP/CMR and EJB QL are very productive.
Check out this 4 part tutorial that is on developerWorks. Here is a site that explains the 4 part series....
4 part series on EJB 2.0 CMP/CMR and EJB QL
I've used EJB CMP/CMR in many production systems. It saved us a lot of time, and energy.
 
Siegfried Heintze
Ranch Hand
Posts: 420
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me see if can summarize:
Don't use CMP if there are other folks updating your tables because it (EJB) will cache your data. Does this hold for all entity beans too?

Regarding the tutorial: Can I do the tutorial with JBOSS? if so what databases can I use?
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think what is meant here is that Sun has left the door open for complexities over data cache. This causes problems over transactions and locking. All these should be hidden away from developers. That seems to be Microsoft's take.
As far as Session beans go there could be some uses like non web clients or multiple web applications sharing sessions and for transactional session state. Tyler's article on SFSB are beasts of burden discusses all these.
Thanks
MM(SCEA)
 
Everybody's invited. Even this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic