This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) 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
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!