File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes EJB Transaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB Transaction" Watch "EJB Transaction" New topic
Author

EJB Transaction

vivek kumar
Greenhorn

Joined: Sep 18, 2007
Posts: 13
Hi,
I came across this question:-
Which of the following transaction attributes assigned to a business method willcause the container to throw java.lang.IllegalStateException when
the method calls EJBContext.getRollbackOnly?
a. Mandatory
b. Never
c. NotSupported
d. Required
e. RequiresNew
F. Supports

Answer: B, C, F
A method with Never, NotSupported, or Supports usually runs in an unspecified context.

I am not able to understand why Supports always run in unspecified context.
If the method is called from a transaction then this method should run under that transaction and there will not be any java.lang.IllegalStateException. Any help?
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

I agree "Supports" is an odd-ball. Is it possible the wording of the question should be "could cause" instead of "will cause"?


My Blog: Down Home Country Coding with Scott Selikoff
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB Transaction