Forums Register Login

Puzzling Transactions.....

+Pie Number of slices to send: Send
Hi Guys,
Please clarify this...

Session Bean psudo code

//this method has attribute = REQUIRED
public void method1(){
//statement 1 update some record
method2();
//statement 2
}

//this method has attribute = REQUIRED NEW
public void method2(){
//statement 3 update some other record
//exception is thrown
//statement 4
}

does statement 1,2,3,4 will happen in same transaction context OR 1,2 in different context and 3,4 in different context IF I CALL method1 FROM REMOTE INTERFACE

Thanx in Advance
+Pie Number of slices to send: Send
I hope someone will correct me if I'm wrong. But I think that everything will be under the same transaction. That is because the call from method1 to method2 is not done using the Remote interface, so the call isn't intercepted by the container.
+Pie Number of slices to send: Send
 

Originally posted by Brian Tinnel:
I think that everything will be under the same transaction. That is because the call from method1 to method2 is not done using the Remote interface, so the call isn't intercepted by the container.


Precisely. This took me an absurdly long time to figure out I'm sad to say. However, you can easily get around it by going through the local interface.

I found it helpful to add this code block to any beans that were calling themselves and needed those further calls to be intercepted. Just change the two local interface references as appropriate.
I'm sure glad that he's gone. Now I can read this tiny ad in peace!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 461 times.
Similar Threads
Want Help on IBM 158 exam
Thread synchronization
Another method invocation question...
clarification on why the modifier private changes output..
EJB Transaction
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 01:43:21.