Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
  • salvin francis
  • Frits Walraven
  • Piet Souris

Question about entity bean

Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In HF EJB book, page 142, it says "the server uses only one bean to represent a particular entity", however, in the book Mastering EJB by Ed Roman, page 114, it says "Several Entity Bean Instances May Represent the Same Underlying Data", so which one is correct?
Cowgirl and Author
Posts: 1589
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good question
The difference is in the definition of "bean" vs. "bean *instance*". A "bean" is a bean type, like, "CustomerBean". But several different CustomerBean *instances* might be used by the Container for a given underlying entity (in other words, a given underlying Customer).
The spec plays a little loose with that terminology--most of the time, we don't have to make a distinction between the word "bean" and the phrase "bean instance", but sometimes it does matter.
The main time the difference matters is when we talk about bean *removal* where an entity bean is *removed* and a particular Customer bean is *deleted* even though the actual underlying bean *instance* just goes back into the pool, and is never actually destroyed. The conceptual entity (say, the bean representing Fred Smith) is *removed* but the bean *instance* is not.
I child proofed my house but they still get in. Distract them with this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic