This may be a repost, though I think I didn't post to the correct
address earlier this week.

========================================================================
=======================================
Hi,

I've written a servlet hosted in Tomcat that accesses a Xindice instance
directly from the servlet.

------------------------------------------------------------------------
---------------------------------------
The servlet's service method looks something like the following code
fragment:


...
String strXindiceDriver =
"org.apache.xindice.client.xmldb.DatabaseImpl";
Class clXindiceDBClass = Class.forName(strXindiceDriver);
dbXindiceDatabase = (Database) clXindiceDBClass.newInstance();
DatabaseManager.registerDatabase(dbXindiceDatabase);
...

this.xindiceCurrentCollection =
DatabaseManager.getCollection("xmldb:xindice://"  + collectionName); ...

XPathQueryService xpqsService = (XPathQueryService)
xindiceCurrentCollection.getService("XPathQueryService", "1.0");

...

ResourceSet rsResultSet = xpqsService.query(strXpath);

...
 
------------------------------------------------------------------------
-------------------------------------------

My main questions:

Since the servlet container (e.g. Tomcat) is allowed to invoke a
servlet's service method on multiple threads/requests at the 'same'
time, is the code snipped threadsafe and multiuser safe?

If it is threadsafe/multiuser safe, at what 'point' does it beome so.
For instance, can I run the registration code once, and just instance a
separate collection for each user?

Thanks for any help and insight.

Tracy

Tracy Flynn
Chief Architect
Learning Objects Network, Inc
[EMAIL PROTECTED] 
http://www.learningobjectsnetwork.com




Reply via email to