Hi Mathias,

1- The client is written in java so I guess I could run into the "garbage
collection" problems you mentioned. Correct?

2- If so is there a mean to prevent to run into those problems while still
using the UNO service you mentioned. I thought about simply calling OO via a
synchronized method in my client. Any idea if it it would be the correct
approach (well in that case I wouldn't even use OO multithread
capabilities)?
Or maybe a better one?

3- What is the "UNO service that can be called with an object receiving a
callback"? Have you any pointer about it (documentation, sample code etc.)?

Thanks

PS: my application does not let the user interact directly with the OO user
interface. When I wrote "based on the user input" in my explanation, I was
talking about "user input from the web application interface". Maybe it was
not so obvious from what I first wrote.

On Mon, Apr 20, 2009 at 11:11 AM, Mathias Bauer <nospamfor...@gmx.de> wrote:

> Kay Ramme - Sun Germany - Hamburg wrote:
>
> > Hi Oscar,
> >
> > Oscar Picasso wrote:
> >> Hi,
> >>
> >> I have read several threads, without definitive answers, about the
> >> current support for multhreading when using openoffice as a server.
> >>
> >> Basically, I have a web application that, at user request, takes an
> >> openoffice template, changes some text, based on the user input, and
> >> generates a pdf file.
> >>
> >> In this context is openoffice thread safe? If not was could be the
> >> result of concurrently calling openoffice to populate a same template
> >> on behalf of different requests?
> > OOo tries to be thread-safe ... but unfortunately it is not really. If
> > you stress it, it dies ...
> >>
> >> Crash? Performance? Confusion (mixing or changing the data?).
> >>
> >> If the openoffice server is not thread safe, I thought about the web
> >> requests calling openoffice from the command line. But in that case,
> >> do concurrent calls use the same openoffice instance? Is it safe from
> >> the data integrity point of view?
> > Running one client at a time gives you good chances that the application
> > does not crash.
> >>
> >> In short what is the safest way for openoffice to solve this use case.
> > Good question ... the safest way is to use the "main-thread" for doing
> > operations in OOo, though this one is not directly reachable from
> > another process.
>
> Well, in fact it nowadays is. There is a UNO service that can be called
> with an object receiving a callback. This callback will happen in OOo's
> main thread and by moving all code into this callback you will have your
> code executed as if it was called from e.g. OOo's menu bar.
>
> You still may have problems when your application is written in a
> languagge using garbage collection as this can lead to desctructor calls
> of OOo objects executed in the garbage collection thread.
>
> Best regards,
> Mathias
>
> --
> Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
> OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
> Please don't reply to "nospamfor...@gmx.de".
> I use it for the OOo lists and only rarely read other mails sent to it.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
> For additional commands, e-mail: dev-h...@api.openoffice.org
>
>

Reply via email to