Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 89138 invoked from network); 24 Mar 2004 17:29:38 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 24 Mar 2004 17:29:38 -0000 Received: (qmail 54684 invoked by uid 500); 24 Mar 2004 17:27:26 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 54636 invoked by uid 500); 24 Mar 2004 17:27:26 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 54523 invoked from network); 24 Mar 2004 17:27:24 -0000 Received: from unknown (HELO t8.cwihosting.com) (64.49.220.142) by daedalus.apache.org with SMTP; 24 Mar 2004 17:27:24 -0000 Received: from t8.cwihosting.com ([64.49.220.142] helo=carmani600m) by t8.cwihosting.com with esmtp (Exim 4.24) id 1B6C9v-0008UT-5G for commons-user@jakarta.apache.org; Wed, 24 Mar 2004 10:27:19 -0700 From: "James Carman" To: "'Jakarta Commons Users List'" Subject: RE: Digester and Threads Question Date: Wed, 24 Mar 2004 12:27:04 -0500 Organization: Carman Consulting, Inc. Message-ID: <000d01c411c5$3d917970$7153058f@carmani600m> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: <4061C2C5.8050309@ignos.com> Importance: Normal X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - t8.cwihosting.com X-AntiAbuse: Original Domain - jakarta.apache.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - carmanconsulting.com X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Or you could just use a pool (Jakarta Commons Pool). You would have to implement your own PoolableObjectFactory which basically creates/manages your Digester instances. -----Original Message----- From: Adrian Perez Jorge [mailto:aperez@ignos.com]=20 Sent: Wednesday, March 24, 2004 12:18 PM To: Jakarta Commons Users List Subject: Re: Digester and Threads Question Hi, What would be the nice way to use a digester per thread? Suppose the=20 number of threads is bounded, so a digester could be created to serve=20 each thread. The idea is to have a multiton and get from it the right=20 digester for the running thread. To build the multiton load once the rules for the digester (well..I=20 use xmlrules, so this process is somewhat expensive), then clone the=20 digester in a lazy way (i.e. as threads are created). Will just a Hashtable do the job where the keys are Threads objects?=20 What do you think? Cheers, Adrian P.J. James Carman wrote: >As long as you use a new Digester each time (like as a local variable inside >a method), you'll be fine. What that means is that you CANNOT use one >single digester instance in multiple threads at the same time. > >-----Original Message----- >From: Alan Pocklington [mailto:ajp@pocko.freeserve.co.uk]=20 >Sent: Wednesday, March 24, 2004 11:24 AM >To: commons-user@jakarta.apache.org >Subject: Digester and Threads Question > >Hi, > >I want to use the Digester in a web application to parse XML documents = on=20 >the fly. Basically, the user logs in and his corresponding XML file is = >loaded from the database, parsed using Digester and displayed to the = user=20 >for manipulation. > >I'm concerned about the following line in the JavaDoc: > >"A single Digester instance may only be used within the context of a = single >thread at a time, and a call to parse() must be completed before = another=20 >can be initiated even from the same thread." > >I'm not sure if I fully understand what this is saying. Will this mean = I=20 >will face problems using the Digester in the above way in a web=20 >application? Is it saying that I can use only one digester instance to = >service all requests, or will it be okay to put Digester code in my = servlet > >which will create a Digester for each request? > >Please help, I'm confused. > >Thanks in advance, > >Alan. > > =20 > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org