• Post Reply Bookmark Topic Watch Topic
  • New Topic

transaction doubt  RSS feed

 
Aditya Vasudeva
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can the setRollbackOnly() method be called in the absence of a transaction??

well...ucertify definitely agrees to this !!
 
Mirko Bonasorte
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

See 13.6.2.8 from JSR-220.
 
Vinay Nath
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Aditya,

some of these questions are very tricky, when they say: can call or can call succesfully because you sure can call it beacuse EJBContext has been injected and available but you cant call it successfully and it will throw IllegalStateException. It depends on how a question is worded.
 
Rafael Rocha
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
only beans with persistence context CMT can call setRollbackOnly() method
[ July 20, 2008: Message edited by: Rafael Rocha ]
 
E Lievaart
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Usually on exams, when sun asks: can the method be called?
Sun means: will the method call complete successfully?
The answer to the question is no, as far as I am concerned.
 
Vinay Nath
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well if the question is about Operations allowed, then I am pretty sure it is allowed. So if the question is asking whether you can call a method while a transaction context or not then you have to answer according to that.

When question asks: can this operation be sucessfully completed then you have to take into consideration whether it succeeds or not.

So how the question is worded is important, I wouldnt assume anything about Sun questions because the questions are worded in a very specific manner. So it becomes important to not only know if something is possible but also if it is right to do it or not.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!