This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin 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
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

jdiscuss question  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i cannot solve this question
http://jdiscuss.com/Enthuse/jsp/ShowAvailableTests.jsp
Test - 3
Question - 2
(sorry for the inconvinience i cannot paste it as it has figures)

can some one explain the basic principle.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question has to do with the transaction attributes for methods in a CMT bean.

methodA : RequiresNew
methodB : Required
methodC : NotSupported
methodD : RequiresNew

methodA calls methodB. methodB calls methodC and methodD.

1. methodA runs in TxA.

2. Since methodB's transaction attribute is Required and it is called from methodA with an existing transaction context TxA, methodB runs in that existing transaction of TxA.

3. methodC's transaction attribute is NotSupported and it is called from methodB. Since there is an existing transaction TxA for methodB, the context for the caller method (methodB) will be suspended in this case and methodC will run in an "unspecified transaction context" .

4. methodD's transaction attribute is RequiresNew and it is called from methodB. Since there is an existing transaction TxA for methodB, the caller's (methodB) transaction TxA gets suspended, and methodD will run with a new transaction TxD.


So, the correct answer is :
methodA (TxA) --> methodB (TxA)
methodB (TxA) --> methodC (no transaction context)
methodB (TxA) --> methodD (TxD)
 
preethi bhat
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank u Anshul
 
Screaming fools! It's nothing more than a tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!