Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

what is the benefits of usinf Entity bean ?  RSS feed

 
ruilin yang
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could anyone give me some clarification on using entity beans over a servlet/JSP->JDBC database system ?
It seems to me it is a lots more work to implement entity beans that to use a servlet/JSP->JDBC database system.
Please comments.
Thanks in advance
Ruilin
confused
[This message has been edited by ruilin yang (edited August 21, 2001).]
[This message has been edited by ruilin yang (edited August 21, 2001).]
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Essentially, an entity bean is a Java wrapper for a row in a table in a DB.
At least that's how it all began. Your mileage may vary...
Others may enhance upon this very brief explanation...
 
Manjunath Subramanian
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello Ruilin,
Entity beans have this feature of caching the requested
records in the application server itself, so that they can be
used in future without having to place another call to the
database. I think this is the main advantage.
Manjunath
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Although you could (and even should in some cases) use session beans to access data. The major advantage of using Entity Beans is that they 'know' when data needs to be persisted i.e. you don�t have to tell your bean when to read a line from the db and when to write data to the database. Their major disadvantage is the fact that they are not as scalable as Stateless Sessions Beans. A query for 1000 records in your DB could mean you would be instantiating 1000 beans in the container.
 
John Bateman
Ranch Hand
Posts: 320
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Another benefit is that you don't have to code all that SQL into an entity bean. You just setup the mapping with the bean abd the database tables that is represents and you're off.
If you get into entity beans make sure you look at Bean Managed and Container Managed. They each have pros and cons.
Some 'watch outs':
CMP -> no guarantee that they can handle complex relations.
BMP -> you are now coding all that sql I said you didn't have to code.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!