|
From: Guillaume P. <gpo...@gl...> - 2004-03-07 15:26:23
|
Also, I ran a similar Test Case against XmlBeanFactory with prototypes and custom PropertyEditors, and it failled the test. I assume BeanFactory is supposed to be thread safe since it can be shared in a client-server environnement. Making the method AbstractAutowireCapableBeanFactory.createBean(String, RootBeanDefinition) synchronized fixed my particular test case, but I'm not sure if it's the best way to get around this problem. The test case is attached to this mail, all of the files should go in the package org.springframework.beans.factory. I would fill an issue in JIRA, but I didn't see a way to include an attachement, so I thought I should probably just post here. Guillaume ----- Original Message ----- From: "Alef Arendsen" <al...@jt...> To: <spr...@li...> Sent: Sunday, March 07, 2004 7:35 AM Subject: RE: [Springframework-developer] BeanWrapperImpl & PropertyEditors I ran the testcase and it seems you're right ;-). I'll include it in JIRA, Jürgen should have a look at this, he's the BeanWrapper expert ;-). Alef > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...] On Behalf > Of Guillaume Poirier > Sent: Saturday, March 06, 2004 6:04 AM > To: spr...@li... > Subject: Re: [Springframework-developer] BeanWrapperImpl & PropertyEditors > > I have created a test case to illustrate the problem, and fixed the > BeanWrapperImpl code so that it passes my test case. Both are included in > the patch attached to this E-Mail. Feel free to use/modify the code. > (The > number of threads created might need adjustement). > > Guillaume > > ----- Original Message ----- > From: "Guillaume Poirier" <gpo...@gl...> > To: <spr...@li...> > Sent: Friday, March 05, 2004 1:02 PM > Subject: [Springframework-developer] BeanWrapperImpl & PropertyEditors > > > > Hello, > > > > While answering to the question concerning PropertyEditors in the post > "permanantly registering property editor with BeanWrapper?", I looked the > the source code of BeanWrapperImpl and noticed something. It sounds like > BeanWrapperImpl's class is not thread safe? And I don't mean instance of > the class, but rather the class itself. There's a static HashMap > defaultEditors that contains PropertyEditors. However, PropertyEditors > are > not thread safe. That means if there's two threads using two different > instances of BeanWrapperImpl at the same time, there's a possiblity they > both get a reference on the same PropertyEditor, and that the getValue() > of > the first one to call setAsText is the value of the second one that called > that method. Or am I missing something? > > > > Guillaume > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: IBM Linux Tutorials > > Free Linux tutorial presented by Daniel Robbins, President and CEO of > > GenToo technologies. Learn everything from fundamentals to system > > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > > _______________________________________________ > > Springframework-developer mailing list > > Spr...@li... > > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=ick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |