[Transaction]
Class {
[AutoComplete]
Void X (){
New B (). Y ();
}
}
[Transaction]
Class B {
[AutoComplete]
Vlid y ();
}
Transaction transmission is between methods. How does y () Know the transactions in its upper-layer calls?
Thought 1:
Framestack is the hierarchical relationship of method calls. Finding the most recent method with a transaction, the transaction where it is located is needed. The question is, how can we get the transaction of that method? Except for explicit parameters, is there any other way to transmit information to the descendant method?
Idea 2:
Context. context in remoting refers to a context, such as an object activated by a remote client. context exists throughout its lifecycle, and any objects that are re-activated in the server method belong to the same context. you can use contextboundobject to easily achieve this effect. if you want different objects to have their own transaction requirements (required/disabled ...), each object must have its own context. is there a simpler solution?