• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

NorSupportedException in BMT Stateful session beans

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
consider a business method in a stateful session bean with bean managed transaction

public void bussinessMethod()
{
UserTransaction ut = this.sessionContext.getUserTransaction();
ut.begin();
UserTransaction ut2 = this.sessionContext.getUserTransaction();
ut.begin();
}

is this code supposed to handle the transqaction related checked exceptiopns.
ut.begin() throws a javax.ejb.NotSupportedException which is a checked exception.
its obvious it must handle it, but i am asking to confirm that as none of the code samples i have looked at seems to be showing that.

thank you very much for you time, i really appreciate it.
sid
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You probably don't get the exception handling in the interest of code clarity. I would expect this code to throw NotSupportedException. This should be handled and setRollbackOnly() invoked.
 
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
are you sure it is defined as bmt? not cmt?
 
Everybody's invited. Even this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic