• Post Reply Bookmark Topic Watch Topic
  • New Topic

BMP Entity Bean  RSS feed

 
Aamir Khan
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
While we use the BMP entity beans , we have to write the code for database access, transaction etc.Then why we are using entity beans why not directly connect to database from session beans???
 
Poornima Shetty
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again,
See in case of Session Beans you might be knowing ,they dont store the objects persistent state to a secondary storage area i.e in short they are basically client oriented and the moment the client finishes his transaction the session terminates and the bean is detroyed thus its 1:1 i.e one client per bean,session beans are transient and not persistent and they cannot share data across multiple clients but in case of Entity beans the data is persistent as long as data exists in the database and can share data across multiple clients i.e EB represent persistent state objects (things that dont go away when the user goes away).

Hence when you want to make your data to be persistent then you have to go for entity beans.
Rgds,
Poornima.
 
Aamir Khan
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Poornima.Its a lot more clear now.
 
Rajesh Hegde
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think , we can have an Entity bean wherein the container takes care of persistence and Transaction. Its not always necessary for you to write code for persistence. I think you can specify the same in the deployment descriptor.
Rajesh
 
Rajesh Hegde
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh ,i am sorry i overlooked the fact that u are refering to BMP.
Rajesh
 
sarah00
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
session beans are transient and not persistent and they cannot share data across multiple clients.
But if directly connect to database from session beans, and
use JDBC (update, insert...) to manipulate the dabase,
other clients still can share the data. RIght?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!