Thoughts on lightweight transaction control

Source: Internet
Author: User

Class {
Void X (){
New B (). Y ();
Class B {
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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.