• 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
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

pg. 497

 
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In 2nd Q --which tx attibute must not be used for MDB??
The ans -- ReqNew,Mand,Never,Supports
I don't understnd how is that??

Mand & Never throws exception ok fine...
Then what about supports & Reqnew??
I thought for MDB there should not be any previous tx context ..so, Supports must not be used .ok fine again
then why ReqNew?? & why not Required??

can anyone understand my point?? if yes, pls reply & clarify where I'm wrong
 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Required means that the bean is running in the tx from the incomming request, or in a new one if there is no incomming tx. But for MDB there is no incomming request, since there is no client! So RequiresNew is a "cleaner" definition in a way...

But I agree it is a bit tricky, I have also wondered why only RequiresNew and not Required...

Miki
 
Deepa Korecherla
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess ReqNew can be used rather than Required... b'coz its not required to run in the previous tx for MDB.
Can anyone clarify?? I'm confused!!!
 
Ranch Hand
Posts: 250
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
There is nothing written in specs that why RequiresNew can't be used but I think the possible reason is that in case of MDB with CMT the message receipt is included as a part of the bean's transaction . That means (message receipt + onMessage()) makes on transaction. If the specs would have allowed RequiresNew then you can see the problem with the message receipt.

This is what I think and I haven't read it anywhere .

Sawan
SCJP,SCWCD,SCBCD
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
https://coderanch.com/t/160802/java-EJB-SCBCD/certification/MDB-transaction-attribute
 
Deepa Korecherla
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you all for all ur replies!!
I guess I have to remember MDB must use only Required & Not Supported
Required & Not Supported
Required & Not Supported
Required & Not Supported
Required & Not Supported
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey it easy to figure out why if you know that a MDB is never called in Tx of a client.
So then the logic is:

ReqNew - does not make sense since the is no "old" transaction

Mand - if you specify this the method will alway throw an exception of course this can never be what you want

Never - This is allways the case so why should you specify it again? you specify Never to throw an exception when a method is called in Tx context, bit this nver happens with a MDB so why specify Never

Supports - There is no client Tx to Support!!!
 
Now I am super curious what sports would be like if we allowed drugs and tiny ads.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic