• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Entity beans cannot use BMT

 
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is reason behind Entity beans cannot use Bean managed transaction?
Thanks
 
Ranch Hand
Posts: 563
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's a repost :
https://coderanch.com/t/163000/java-EJB-SCBCD/certification/BMT-Entity-beans
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure if this is entirely accurate, but these are my thoughts.

Entity Beans exist because there is an entity in the DB that they represent. CMP fields representing the complete entity are declared in the DD, along with abstract getters and setters.

On the other hand, with BMT, the bean manages DB access code by itself upon notification from the container. That means, we could do DB access code or do nothing in the BMT container callback methods. But with CMT, container is in charge of putting the required code for DB access.

This makes me think that a BMT bean is not tied to any real entity. And if its not tied to any real entity, it cannot be an entity bean.

Another point to note is that if a session bean uses an entity bean and if the session bean is in a transaction and wants the entity bean (DB) updates to happen as a part of the same transaction, only CMT would support it. With BMT, the entity bean methods would run in a seperate transaction. So, a scenario like "Insert New Customer through a session bean which uses entity bean" will run into issues.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic