Forums Register Login

Portable transaction

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
Thanks a lot. Your answer helps me with my confidence in the exam.

Shiang
+Pie Number of slices to send: Send
Found my answer in spec pg. 352.

Shiang
You're not going crazy. You're going sane in a crazy word. Find comfort in this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 700 times.
Similar Threads
Portable transaction
Transaction
HF EJB "Sharpen your pencil p. 497"
Transaction attributes and unspecified transaction context
TRANSACTION CONTEXT
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 16:53:24.