*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Portable transaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Portable transaction" Watch "Portable transaction" New topic
Author

Portable transaction

Shiang Wang
Ranch Hand

Joined: Jun 20, 2003
Posts: 96
Here is another question I posted in the wrong forum.

Why are NotSupported, Supports, and Never transaction attributes NOT PORTABLE? Is that because methods in these attributes might not be in transaction context?

Thanks
Shiang


SCBCD, SCWCD, SCJP
Timothy Toe
Ranch Hand

Joined: Oct 19, 2002
Posts: 156
I guess you are right.

There is this similarity among
NotSupported, Supports, and Never : all have a possibility that the method that they mark/describe run with an "unspecified transaction context".

While Required, RequiredNew and Mandatory have this �opposite� similarity : all DOES NOT have a possibility that the method that they mark/describe run with an "unspecified transaction context".

A method written by a Bean Provider (BP) might have code that calls these CMT transaction methods :
entityContext.getRollbankOnly() or
entityContext.setRollbankOnly().
These methods need a transaction context to run.

If the BP's method DOES have one of these xxxRollbankOnly methods AND if the method IS mark as NotSupported, Supports or Never, then problem will occur. This is possible since the Application Assembler or the Deployer most probably does not have access to the code.

I think the �problem� mentioned above is that the container will throw TransactionRequired<Local>Exception. (Can someone verify this ?)

I guess this should be the reason why NotSupported, Supports, and Never are labelled as NOT PORTABLE. They are not versatile enough to be used in every possible way.
Shiang Wang
Ranch Hand

Joined: Jun 20, 2003
Posts: 96
Thanks a lot. Your answer helps me with my confidence in the exam.

Shiang
Shiang Wang
Ranch Hand

Joined: Jun 20, 2003
Posts: 96
Found my answer in spec pg. 352.

Shiang
 
 
subject: Portable transaction
 
Similar Threads
Portable transaction
Does EJB Container rollbacks the Transaction in case of a RuntimeException??
Transaction Attribute
WILL NOT BE PORTABLE?why?
WA #1.....word association