• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Portable transaction

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is another question I posted in the wrong forum.

Why are NotSupported, Supports, and Never transaction attributes NOT PORTABLE? Is that because methods in these attributes might not be in transaction context?

Thanks
Shiang
 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess you are right.

There is this similarity among
NotSupported, Supports, and Never : all have a possibility that the method that they mark/describe run with an "unspecified transaction context".

While Required, RequiredNew and Mandatory have this �opposite� similarity : all DOES NOT have a possibility that the method that they mark/describe run with an "unspecified transaction context".

A method written by a Bean Provider (BP) might have code that calls these CMT transaction methods :
entityContext.getRollbankOnly() or
entityContext.setRollbankOnly().
These methods need a transaction context to run.

If the BP's method DOES have one of these xxxRollbankOnly methods AND if the method IS mark as NotSupported, Supports or Never, then problem will occur. This is possible since the Application Assembler or the Deployer most probably does not have access to the code.

I think the �problem� mentioned above is that the container will throw TransactionRequired<Local>Exception. (Can someone verify this ?)

I guess this should be the reason why NotSupported, Supports, and Never are labelled as NOT PORTABLE. They are not versatile enough to be used in every possible way.
 
Shiang Wang
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot. Your answer helps me with my confidence in the exam.

Shiang
 
Shiang Wang
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Found my answer in spec pg. 352.

Shiang
 
If you like strawberry rhubarb pie, try blueberry rhubarb (bluebarb) pie. And try this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic