Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Usertransaction and Entity Beans

 
mini mehta
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Does anybody knows why UserTransaction are not permitted in Entity beans?
Regards
Mini
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy -- I was told it was something like, "Entity beans are always connected to an underlying persistent store, which means they are inherently transactional." Which I think translates to something more like, "We want to make it more harder for you to mess up the database." People can still mess things up, of course, with a bad combination of transaction attributes, but *forcing* you to put transaction attributes on the key methods of entity beans means you have to acknowledge that you're doing important things (INSERT, UPDATE, etc.) to the cricital data. So it's just a protection.
Of course, you could have a development tool that puts in all transaction attributes defaults for you, so that you STILL don't have to acknowledge transactions with your entity beans... but a decent tool will put in "Required" as the default, so that you WILL have a transaction unless you specifically make a point of saying that you don't support a transaction or something.
In other words, the specification makes it a more work for you to *not* use transactions with entity beans.
One more big difference between EJB and jini -- EJB gives you all sorts of protections so it's harder to really do Bad Things ("we don't completely trust you to protect the enterprise data"), while Jini says, "you are on your own... we trust you, and if you want to blow the place up, that's your business."
cheers,
Kathy
 
mini mehta
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Kathy. That clears my doubt.
cheers
mini
btw are you from britian?
 
Nileesha Bojjawar
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kathy,
I am new to EJB.
WRT the above question does that mean an entity bean can not have a Bean Managed Transaction at all?
Thanks
 
Sujatha Kumar
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nileesha ,
Thats right, Entity Beans cannot have Bean Managed Transactions.
Bean Managed Transaction are meant only for Session Beans.
Regards
 
Praveena Venigalla
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
------------------------------------------------------------------------------------
Thats right, Entity Beans cannot have Bean Managed Transactions.
Bean Managed Transaction are meant only for Session Beans.
-------------------------------------------------------------------------------------
Bean Managed Transactions are meant for Sessiona and MessageDriven Beans
Entity Beans can use only Container managed Transactions
Praveena
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic