This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

BMP and CMP a Arch. mistake?

 
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 28325
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 428
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Grow a forest with seedballs and this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic