|
From: Stefan K. <ste...@co...> - 2003-08-13 06:03:44
|
Jonathan is right.
This problem is in 1.0 and at least 1.1.5-DEV.
We are using babeldoc in a J2EE environment and this is multi-threaded for
sure.
Regards,
Stefan
> -----Ursprüngliche Nachricht-----
> Von: Bruce McDonald [mailto:br...@mc...]
> Gesendet: Mittwoch, 13. August 2003 01:51
> An: Leech, Jonathan; Stefan Krieger; McDonald, Bruce;
> bab...@li...
> Betreff: Re: AW: [Babeldoc-devel] Synchronization Problem in
> PipelineStage Factory
>
>
> I think there is a disclaimer somewhere to forswear this kind of thing!!!
>
> On Tuesday 12 August 2003 06:52 pm, Leech, Jonathan wrote:
> > Even though babeldoc 1.0 isn't itself multithreaded, he would have that
> > problem if he has multiple threads invoking babeldoc.
> >
> > -Jonathan
> >
> > -----Original Message-----
> > From: Bruce McDonald [mailto:br...@mc...]
> > Sent: Tuesday, August 12, 2003 4:42 PM
> > To: Stefan Krieger; McDonald, Bruce;
> > bab...@li...
> > Subject: Re: AW: [Babeldoc-devel] Synchronization Problem in
> > PipelineStageFactory
> >
> >
> > Yes,
> >
> > Things are moving - that is good - we need progress and there is lots to
> > do.
> >
> > I encourage everyone to get in now while babeldoc development is open.
> >
> > As for your problem with threading - this does not happen in 1.0.
> >
> > regards,
> > Bruce.
> >
> > On Tuesday 12 August 2003 05:58 pm, Stefan Krieger wrote:
> > > Bruce,
> > >
> > > hui, I've looked at PipelineStageFactory Rev 1.12.
> > > I just realizied that there's already 1.16. You're quite fast.
> > > Well, the problem is that my project still is on babeldoc 1.0.
> > > It's enough thrill for the customer to use open source,
> > > I can't even push them on the development stream ;-)
> > >
> > > Babeldoc should stabilize soon and make a new stable release.
> > >
> > > Regards,
> > > Stefan
> > >
> > > > -----Ursprüngliche Nachricht-----
> > > > Von: McDonald, Bruce [mailto:Bru...@ba...]
> > > > Gesendet: Dienstag, 12. August 2003 23:31
> > > > An: Stefan Krieger; bab...@li...
> > > > Betreff: RE: [Babeldoc-devel] Synchronization Problem in
> > > > PipelineStageFactory
> > > >
> > > >
> > > > Stefan,
> > > >
> > > > What class are you referring to here? This method
> > > > getPipelineStage is on IPipelineStageProcessor. The
> > > > multithreaded implementation of interest is the
> > > > SynchronousPipelineStageProcessor. This already protects its
> > > > stages cache in a ThreadLocal. Please check that your code
> is recent.
> > > >
> > > > regards,
> > > > Bruce
> > > >
> > > > -----Original Message-----
> > > > From: Stefan Krieger [mailto:ste...@co...]
> > > > Sent: Tuesday, August 12, 2003 1:35 PM
> > > > To: bab...@li...
> > > > Subject: [Babeldoc-devel] Synchronization Problem in
> > > > PipelineStageFactory
> > > >
> > > >
> > > > Folks,
> > > >
> > > > The caching of stage instances in PipelineStageFactory is really
> > > > a problem.
> > > > Each concurrent thread gets the same stage instances and then each
> >
> > thread
> >
> > > > sets document and ticket in the stage and the result is a mess !
> > > > Does the caching have any reason ? I think we should drop
> it in favor
> > > > of more stability.
> > > >
> > > > Cheers,
> > > > Stefan
> > > >
> > > > This is the original method:
> > > >
> > > > public IPipelineStage getPipelineStage(String stageName)
> > > > throws PipelineException {
> > > > if (stages == null) {
> > > > getLog().logDebug(I18n.get("019005", "new"));
> > > > stages = new HashMap();
> > > > }
> > > >
> > > > if (!stages.containsKey(stageName)) {
> > > > getLog().logDebug(I18n.get("019005", stageName));
> > > > try {
> > > > PipelineStageType pipelineStageType =
> > > > getPipelineStageType(stageName);
> > > > Class stage = pipelineStageType.getTypeClass();
> > > > if (stage != null) {
> > > > IPipelineStage pstage = (IPipelineStage)
> > > > (stage.newInstance());
> > > > pstage.setName(stageName);
> > > > pstage.setResolver(getResolver());
> > > > pstage.setPipelineName(this.getName());
> > > > stages.put(stageName, pstage);
> > > > } else {
> > > > throw new PipelineException(I18n.get("019010",
> > > > pipelineStageType.getTypeName()));
> > > > }
> > > > } catch (InstantiationException ie) {
> > > > throw new PipelineException(ie.getMessage(), ie);
> > > > } catch (IllegalAccessException iae) {
> > > > throw new
> PipelineException(iae.getMessage(), iae);
> > > > }
> > > > }
> > > >
> > > > return (IPipelineStage) stages.get(stageName);
> > > > }
> > > >
> > > > Here is my patch. However, I created my own PipelineStageFactory
> > > > class with
> > > > this in it.
> > > >
> > > > public IPipelineStage getPipelineStage(String stageName) throws
> > > > PipelineException {
> > > > getLog().logDebug(I18n.get("019005", stageName));
> > > > try {
> > > > PipelineStageType pipelineStageType =
> > > > getPipelineStageType(stageName);
> > > > Class stage = pipelineStageType.getTypeClass();
> > > > if (stage != null) {
> > > > IPipelineStage pstage = (IPipelineStage)
> > > > (stage.newInstance());
> > > > pstage.setName(stageName);
> > > > pstage.setResolver(getResolver());
> > > > pstage.setPipelineName(this.getName());
> > > > return pstage;
> > > > } else {
> > > > throw new PipelineException(I18n.get("019010",
> > > > pipelineStageType.getTypeName()));
> > > > }
> > > > } catch (InstantiationException ie) {
> > > > getLog().logError(ie);
> > > > throw new PipelineException(ie.getMessage(), ie);
> > > > } catch (IllegalAccessException iae) {
> > > > getLog().logError(iae);
> > > > throw new PipelineException(iae.getMessage(), iae);
> > > > }
> > > > }
> > > >
> > > >
> > > >
> > > > -------------------------------------------------------
> > > > This SF.Net email sponsored by: Free pre-built ASP.NET
> sites including
> > > > Data Reports, E-commerce, Portals, and Forums are available now.
> > > > Download today and enter to win an XBOX or Visual Studio .NET.
> > > > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072
> > > > 303_01/01
> > > > _______________________________________________
> > > > Babeldoc-devel mailing list
> > > > Bab...@li...
> > > > https://lists.sourceforge.net/lists/listinfo/babeldoc-devel
> > >
> > > -------------------------------------------------------
> > > This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> > > Data Reports, E-commerce, Portals, and Forums are available now.
> > > Download today and enter to win an XBOX or Visual Studio .NET.
> >
> >
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072
> 303_01/01
> >
> > > _______________________________________________
> > > Babeldoc-devel mailing list
> > > Bab...@li...
> > > https://lists.sourceforge.net/lists/listinfo/babeldoc-devel
> >
> > -------------------------------------------------------
> > This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> > Data Reports, E-commerce, Portals, and Forums are available now.
> > Download today and enter to win an XBOX or Visual Studio .NET.
> >
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072
> 303_01/01
> > _______________________________________________
> > Babeldoc-devel mailing list
> > Bab...@li...
> > https://lists.sourceforge.net/lists/listinfo/babeldoc-devel
> >
> >
> > -------------------------------------------------------
> > This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> > Data Reports, E-commerce, Portals, and Forums are available now.
> > Download today and enter to win an XBOX or Visual Studio .NET.
> >
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072
> 303_01/01
> > _______________________________________________
> > Babeldoc-devel mailing list
> > Bab...@li...
> > https://lists.sourceforge.net/lists/listinfo/babeldoc-devel
>
|