Re: [Betwixt] is betwixt thread safe ?

2011-08-16 Thread Simone Tripodi
Hi Patrick, indeed, when ingesting XML documents you have to make sure the Digester instance is not used in other running threads; sometimes creating new BeanReader instances could require time, that's why I suggested you using a Pool of BeanReader. Sure, paste your code on pastie.org or similar (i

Re: [Betwixt] is betwixt thread safe ?

2011-08-15 Thread patrick daures
Hi again, >From what I found on the web, it's not safe to reuse the same instance of a Digester between different threads. But what I'm currently doing is creating a new instance of BeanReader (which extends the Digester class) for every call, which means that I shouldn't have any multithreading is

Re: [Betwixt] is betwixt thread safe ?

2011-08-15 Thread Simone Tripodi
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, yo

Re: [Betwixt] is betwixt thread safe ?

2011-08-15 Thread patrick daures
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 need to serialize / unserialize data. Cou

Re: [Betwixt] is betwixt thread safe ?

2011-08-14 Thread Simone Tripodi
Hi Patrick! you're welcome, let us know about your results! Have nice 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 1

Re: [Betwixt] is betwixt thread safe ?

2011-08-14 Thread Patrick Daures
Ok, thank you very much for your advice. I will take the 3rd solution Patrick Le 14 août 2011 à 20:24, Simone Tripodi a écrit : > 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

Re: [Betwixt] is betwixt thread safe ?

2011-08-14 Thread Simone Tripodi
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 IMHO; - re-create the deserializer for each request; - use Betwixt in combination with commons-pool, get/rele

[Betwixt] is betwixt thread safe ?

2011-08-13 Thread patrick daures
Hi, i'm currently using betwixt in produit to serialize and unserialize 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 the problem co