Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP 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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

record updation in entity beans with attribute "never"?

 
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If entity bean transaction attribute is Never or Not supported then is it possible to update or create entity beans( update or delete records)? is this transaction attribute is for entire entity bean or per method?
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by yamini nadella:
If entity bean transaction attribute is Never or Not supported then is it possible to update or create entity beans(update or delete records)?



You can still do data manipulation but you won't have access to a transaction and therefore you have no way to force or detect a rollback.

Never, NotSupported and Supported (without a pre-existing transaction) execute in an �an unspecified transaction context�. The spec leaves it to the server vendors to do as they seem fit - there could actually be a transaction out there, however you don't know, and even if you did, you couldn't access the transaction. see:

Enterprise JavaBeans Specification, Version 2.0


Chapter 17 Support for Transactions
17.6.5 Handling of methods that run with �an unspecified transaction context�
...
The EJB specification does not prescribe how the Container should manage the execution of a method with an unspecified transaction context�the transaction semantics are left to the Container implementation.
...
A failure that occurs in the middle of the execution of a method that runs with an unspecified transaction context may leave the resource managers accessed from the method in an unpredictable state. The EJB architecture does not define how the application should recover the resource managers� state after such a failure.



Originally posted by yamini nadella:
is this transaction attribute is for entire entity bean or per method?



Neither NotSupported nor Never is different in the DD configuration to the remaining four transaction attributes.
They may apply to the entire bean if the wildcard is used and no more specifics have been configured (see below).
So Never and NotSupported could actually be applied to a single method and even a single method with a specific signature.

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic