On Tue, Mar 9, 2010 at 11:05 AM, George Baxter <[email protected]> wrote:
> Hi all,
>
> We're hoping to use Tuscany for our stateless services. These services, by
> and large, can be (and should be) totally stateless and thus, in the interest
> of lower GC issues, singletons. Great, we @Scope them as Composites.
>
Well, maybe this is a bug in Tuscany and we should implement support
for stateless more efficient (e.g by providing a pool of instances).
Could you please fire a jira and mention the release you are using.
As you mentioned, @Scope("Composite") could be a possible workaround
for now.
> However, if we want to have an asynchronous 'conversation' with these...
> well.. we haven't figured out how to do it.
>
> Issues:
>
> 1. The callback functionality is injected into the destination component
> object rather than maintained by a proxy. If this object is a singleton-ish
> entity.. well, not thread safe.
> 2. When the callback is actually made, the originating caller (that might be
> scoped as 'Conversation') can't be located and a new instance is created.
> This may be because the singleton's callback is being corrupted
> (overwritten).. thus just another variant of issue 1.
>
> So is it possible to scope a component as a 'Composite' and yet enable
> 'Stateless' or 'Conversation' scoped components interact with them in any
> asynchronous way?
>
In this case, it seems that we are actually making the stateless
service statefull, by injecting callBack information. How about trying
something like passing the current object in the business operation
(e.g foo(this, par1, parm2)) ?
Let me know if this helps you.
--
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/