Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 96C297834 for ; Mon, 15 Aug 2011 18:19:30 +0000 (UTC) Received: (qmail 39347 invoked by uid 500); 15 Aug 2011 18:19:29 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 39127 invoked by uid 500); 15 Aug 2011 18:19:28 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 39119 invoked by uid 99); 15 Aug 2011 18:19:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Aug 2011 18:19:28 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of simone.tripodi@gmail.com designates 209.85.218.43 as permitted sender) Received: from [209.85.218.43] (HELO mail-yi0-f43.google.com) (209.85.218.43) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Aug 2011 18:19:22 +0000 Received: by yia27 with SMTP id 27so3372124yia.30 for ; Mon, 15 Aug 2011 11:19:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=cxK8jSa/BzjJ+XwyWWhiOXxPscGltmi/OyIjBbMXCvo=; b=A97sO/O40sJHbb0AAIpxcDwVfnVIvGmanXdC6AkqmMNpu/seh6IMDIFvqTnIpAgNux UuRIg/dXCum6oHcWrQRBWHJXXKY0Vh2+jMnWwoiabWuvASN+1xJjqB3VrPJsKkzZLlvx VlDv1yUZvLNxGkQ42iqmA6Js6OPQ+LZXHz178= MIME-Version: 1.0 Received: by 10.150.238.4 with SMTP id l4mr2444728ybh.99.1313432342172; Mon, 15 Aug 2011 11:19:02 -0700 (PDT) Sender: simone.tripodi@gmail.com Received: by 10.150.178.5 with HTTP; Mon, 15 Aug 2011 11:19:02 -0700 (PDT) In-Reply-To: References: <74F3781F-AE6E-4445-A81D-EF834DB6C7B3@gmail.com> Date: Mon, 15 Aug 2011 20:19:02 +0200 X-Google-Sender-Auth: jmZUDMqrMc6VjPs9UdaXn6SmChM Message-ID: Subject: Re: [Betwixt] is betwixt thread safe ? From: Simone Tripodi To: Commons Users List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Patrick, sorry for the misunderstanding I made, for deserializer I meant the BeanReader :P Sorry again, have a nice day! Simo http://people.apache.org/~simonetripodi/ http://www.99soft.org/ On Mon, Aug 15, 2011 at 9:57 AM, patrick daures wrote: > Hi, > I have another question to ask you, you said "get/release a deserializer = for > each request". > For the moment, I don't use any deserializer, I only use BeanReader and > BeanWriter objects. > What I do is create a new instance of one of this object every time I nee= d > to serialize / unserialize data. > Could you please give me an example of code using this "deserializer" to > help me to write the code needed ? > > Thank you > > Patrick > > 2011/8/14 Simone Tripodi > >> Hi Patrick! >> you're welcome, let us know about your results! >> Have =C2=A0nice day, >> Simo >> >> http://people.apache.org/~simonetripodi/ >> http://www.99soft.org/ >> >> >> >> On Sun, Aug 14, 2011 at 8:54 PM, Patrick Daures >> wrote: >> > Ok, thank you very much for your advice. >> > I will take the 3rd solution >> > >> > Patrick >> > >> > Le 14 ao=C3=BBt 2011 =C3=A0 20:24, Simone Tripodi a =C3=A9crit : >> > >> >> Hi Patrick!!! >> >> for the XML -> Object mapping, Betwixt relies on Digester, which is >> >> NOT thread safe. >> >> You have 3 options: >> >> >> >> - synchronize the blocks as you did - anyway it's not the best way IM= HO; >> >> - re-create the deserializer for each request; >> >> - use Betwixt in combination with commons-pool, get/release a >> >> deserializer for each request (same pattern you would do with JDBC >> >> Connection in a DataSource). >> >> >> >> My preferred is the #3, but it's just a matter of tastes ;) >> >> Have a nice day, all the best!!! >> >> Simo >> >> >> >> http://people.apache.org/~simonetripodi/ >> >> http://www.99soft.org/ >> >> >> >> >> >> >> >> On Sat, Aug 13, 2011 at 8:31 PM, patrick daures >> >> wrote: >> >>> Hi, i'm currently using betwixt in produit to serialize and unserial= ize >> >>> objects in XML. Each thread is using a new instance of beanreader to >> >>> unserialize XML. I had a problem with my application, i added a >> synchronized >> >>> around the call to the betwixt lib and everything went fine. Maybe t= he >> >>> problem comes from my app, but i wanted to be sure the lib is thread >> safe. >> >>> Thanks. >> >>> >> >> >> >> --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org >> >> For additional commands, e-mail: user-help@commons.apache.org >> >> >> > >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org >> > For additional commands, e-mail: user-help@commons.apache.org >> > >> > >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org >> For additional commands, e-mail: user-help@commons.apache.org >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org