You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by David Warnock <da...@sundayta.com> on 2003/05/28 02:45:01 UTC

What broker gets used by proxies?

Hi,

If I do the following pseudo code what broker is used to fill the proxies?

   get a broker
   execute a query and get back some contact objects.
   close the broker
   access the proxied list of emailaddresses for a contact

Does the contact remember which broker was used to fill itself and use 
that again to get the proxied objects?

OR

Does the contact get a new broker, use it and close it?


If it is the first of these then I guess I am going to get potential 
multi-user issues as someone else may have started to use that broker by 
the time contact needs to load it's proxied objects.

So do I need to keep hold of a broker until I have finished all the 
operations on all the objects I get from that broker?

Thanks

David
-- 
David Warnock, Sundayta Ltd. http://www.sundayta.com
iDocSys for Document Management. VisibleResults for Fundraising.
Development and Hosting of Web Applications and Sites.



Re: What broker gets used by proxies?

Posted by David Warnock <da...@sundayta.com>.
Armin,

Whew, thanks. Panic over. Still I am re-architecuring a bit for 
performance so the original broker will be around long enough with it's 
cache.

> Proxy was associated with PBKey of the 'original' broker and try find
> an open PB instance with the same PBKey for the current thread, else
> PB-pool was ask for a new PB instance.
> 
> see
> CollectionProxy#getBroker()

-- 
David Warnock, Sundayta Ltd. http://www.sundayta.com
iDocSys for Document Management. VisibleResults for Fundraising.
Development and Hosting of Web Applications and Sites.



Re: What broker gets used by proxies?

Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi David,

----- Original Message -----
From: "David Warnock" <da...@sundayta.com>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Wednesday, May 28, 2003 7:59 PM
Subject: Re: What broker gets used by proxies?


> Can anyone help answer this question:
>
> What broker is used to fill proxied collections when the original
broker
> has been returned to the pool?

Proxy was associated with PBKey of the 'original' broker and try find
an open PB instance with the same PBKey for the current thread, else
PB-pool was ask for a new PB instance.

see
CollectionProxy#getBroker()

regards,
Armin

>
> Thanks
>
> David
>
> > If I do the following pseudo code what broker is used to fill the
proxies?
> >
> >   get a broker
> >   execute a query and get back some contact objects.
> >   close the broker
> >   access the proxied list of emailaddresses for a contact
> >
> > Does the contact remember which broker was used to fill itself and
use
> > that again to get the proxied objects?
> >
> > OR
> >
> > Does the contact get a new broker, use it and close it?
> >
> >
> > If it is the first of these then I guess I am going to get potential
> > multi-user issues as someone else may have started to use that
broker by
> > the time contact needs to load it's proxied objects.
> >
> > So do I need to keep hold of a broker until I have finished all the
> > operations on all the objects I get from that broker?
>
> --
> David Warnock, Sundayta Ltd. http://www.sundayta.com
> iDocSys for Document Management. VisibleResults for Fundraising.
> Development and Hosting of Web Applications and Sites.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>



Re: What broker gets used by proxies?

Posted by David Warnock <da...@sundayta.com>.
Can anyone help answer this question:

What broker is used to fill proxied collections when the original broker 
has been returned to the pool?

Thanks

David

> If I do the following pseudo code what broker is used to fill the proxies?
> 
>   get a broker
>   execute a query and get back some contact objects.
>   close the broker
>   access the proxied list of emailaddresses for a contact
> 
> Does the contact remember which broker was used to fill itself and use 
> that again to get the proxied objects?
> 
> OR
> 
> Does the contact get a new broker, use it and close it?
> 
> 
> If it is the first of these then I guess I am going to get potential 
> multi-user issues as someone else may have started to use that broker by 
> the time contact needs to load it's proxied objects.
> 
> So do I need to keep hold of a broker until I have finished all the 
> operations on all the objects I get from that broker?

-- 
David Warnock, Sundayta Ltd. http://www.sundayta.com
iDocSys for Document Management. VisibleResults for Fundraising.
Development and Hosting of Web Applications and Sites.