You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Martin Holz <ho...@fiz-chemie.de> on 2002/02/06 22:58:13 UTC

Collection threadsafe ?

Hi,

some newbie questions about xindice.
Can I use a collection, which was created with 
DatabaseManager.getCollection in more than one thread?
And is my assumption, that creating the collection is relative slow, correct?

Regards
	Martin

--
Martin Holz  <ho...@fiz-chemie.de>  phone: 0049-30-39977 218 
FIZ CHEMIE BERLIN


Re: Collection threadsafe ?

Posted by Martin Holz <ho...@fiz-chemie.de>.
Kimbro Staken wrote:
> On Wednesday, February 6, 2002, at 02:58 PM, Martin Holz wrote:
> > some newbie questions about xindice.
> > Can I use a collection, which was created with
> > DatabaseManager.getCollection in more than one thread?
>
> It should work, but you need to be careful that you don't call the close
> method at the wrong time.

And to reopen it, if a operation fails. Apparently a collection does not 
survive  a restart of  the database :-)

> > And is my assumption, that creating the collection is relative slow,
> > correct?
>
> Probably, how slow though?

Not that slow. I was considering, if I should close a collection immediately 
after querying a resource and reopen it, if needed or reuse a collection, 
which results in a slightly more complicated progamming logic.

Martin   

--
Martin Holz  <ho...@fiz-chemie.de>  phone: 0049-30-39977 218 
FIZ CHEMIE BERLIN


Re: Collection threadsafe ?

Posted by Kimbro Staken <ks...@dbxmlgroup.com>.
On Wednesday, February 6, 2002, at 02:58 PM, Martin Holz wrote:

> Hi,
>
> some newbie questions about xindice.
> Can I use a collection, which was created with
> DatabaseManager.getCollection in more than one thread?

It should work, but you need to be careful that you don't call the close 
method at the wrong time.

> And is my assumption, that creating the collection is relative slow, 
> correct?
>

Probably, how slow though?

> Regards
> 	Martin
>
> --
> Martin Holz  <ho...@fiz-chemie.de>  phone: 0049-30-39977 218
> FIZ CHEMIE BERLIN
>
>
>
Kimbro Staken
XML Database Software, Consulting and Writing
http://www.xmldatabases.org/