Giter Site home page Giter Site logo

Comments (9)

funky-eyes avatar funky-eyes commented on September 25, 2024 1

In my opinion, this code is just to avoid duplicate proxies. @wangliang181230 , @slievrly , @xingfudeshi , please help to answer this question.

You already answered the question.

这么看来,我们应该缓存bean,而不是beanname,否则多例情况下将不会进行代理
In this case, we should cache the bean instead of the bean name. Otherwise, if there are multiple instances, no proxy will be created.

from incubator-seata.

funky-eyes avatar funky-eyes commented on September 25, 2024

In my opinion, this code is just to avoid duplicate proxies. @wangliang181230 , @slievrly , @xingfudeshi , please help to answer this question.

from incubator-seata.

xingfudeshi avatar xingfudeshi commented on September 25, 2024

In my opinion, this code is just to avoid duplicate proxies. @wangliang181230 , @slievrly , @xingfudeshi , please help to answer this question.

You already answered the question.

from incubator-seata.

StephenFaust avatar StephenFaust commented on September 25, 2024
image 在我的bean使用原型模式 image 容器启动的时候,由于proxyed_set中没有beanName所以可以正常代理成功 image 当我再次从容器获取该bean时,由于使用原型模式,因此,会返回一个新的对象,即需要重新代理它,但是由于proxyed_set已经包含该beanName,因此会直接返回,所以最好我得到的是一个未被代理的原始对象

from incubator-seata.

StephenFaust avatar StephenFaust commented on September 25, 2024
image 最后获取的是原始对象

from incubator-seata.

StephenFaust avatar StephenFaust commented on September 25, 2024

你们所说重复代理,指的是什么情况下会发生重复代理?

from incubator-seata.

StephenFaust avatar StephenFaust commented on September 25, 2024

In my opinion, this code is just to avoid duplicate proxies. @wangliang181230 , @slievrly , @xingfudeshi , please help to answer this question.

You already answered the question.

这么看来,我们应该缓存bean,而不是beanname,否则多例情况下将不会进行代理 In this case, we should cache the bean instead of the bean name. Otherwise, if there are multiple instances, no proxy will be created.

如果直接缓存bean,那是否失去了多例bean的意义,所以,我只是想知道,这个proxyed_set 你们在设计时,是考虑到了重复代理的情况,我想知道,在哪种场景下会出现重复代理?

from incubator-seata.

funky-eyes avatar funky-eyes commented on September 25, 2024

In my opinion, this code is just to avoid duplicate proxies. @wangliang181230 , @slievrly , @xingfudeshi , please help to answer this question.

You already answered the question.

这么看来,我们应该缓存bean,而不是beanname,否则多例情况下将不会进行代理 In this case, we should cache the bean instead of the bean name. Otherwise, if there are multiple instances, no proxy will be created.

如果直接缓存bean,那是否失去了多例bean的意义,所以,我只是想知道,这个proxyed_set 你们在设计时,是考虑到了重复代理的情况,我想知道,在哪种场景下会出现重复代理?

我说的缓存bean是将bean缓存起来,只是用来比较bean是否已经被seata所代理过,不过我目前感觉这种方式也不好,针对多例bean反而可能会出现oom,因为被seata一直引用着。大家可以在这讨论出一个合适的方案来解决这个问题。
What I meant by caching beans is to cache the beans and use them only to check whether they have been proxied by Seata. However, I currently feel that this approach may not be ideal, as it could potentially lead to out-of-memory errors for prototype beans, which are constantly referenced by Seata. Let's discuss and come up with a suitable solution to address this issue.

from incubator-seata.

StephenFaust avatar StephenFaust commented on September 25, 2024

In my opinion, this code is just to avoid duplicate proxies. @wangliang181230 , @slievrly , @xingfudeshi , please help to answer this question.

You already answered the question.

这么看来,我们应该缓存bean,而不是beanname,否则多例情况下将不会进行代理 In this case, we should cache the bean instead of the bean name. Otherwise, if there are multiple instances, no proxy will be created.

如果直接缓存bean,那是否失去了多例bean的意义,所以,我只是想知道,这个proxyed_set 你们在设计时,是考虑到了重复代理的情况,我想知道,在哪种场景下会出现重复代理?

我说的缓存bean是将bean缓存起来,只是用来比较bean是否已经被seata所代理过,不过我目前感觉这种方式也不好,针对多例bean反而可能会出现oom,因为被seata一直引用着。大家可以在这讨论出一个合适的方案来解决这个问题。 What I meant by caching beans is to cache the beans and use them only to check whether they have been proxied by Seata. However, I currently feel that this approach may not be ideal, as it could potentially lead to out-of-memory errors for prototype beans, which are constantly referenced by Seata. Let's discuss and come up with a suitable solution to address this issue.

所以我还是需要了解到这个proxyed_set到底是为了避免那种场景下的重复代理,因为在spring中默认是单例模式,warpIfNecessary()只会走一次,生成的代理对象会放在单例池中,后续也不会出现重复代理的情况

from incubator-seata.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.