Issue 73327 - oo hangs when printing multiple documents
Summary: oo hangs when printing multiple documents
Status: CLOSED NOT_AN_OOO_ISSUE
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All Windows XP
: P3 Trivial
Target Milestone: ---
Assignee: jsc
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-10 09:59 UTC by rpavelic
Modified: 2013-02-24 21:07 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description rpavelic 2007-01-10 09:59:31 UTC
When printing in OO2.1 using .NET and C# if function for printing is called from
another thread while first thread hasn't finished printing OO hangs.

Workaround is to use locking so that only one thread can access the print job,
but this is only localized at application level. I guess OO can still hang if he
gets a job from another application.

Code example:
public bool PrintDocument()
{
    lock (sync)
    {
        try
        {
            XPrintable xPrint = (XPrintable)xTextDocument;
            PropertyValue[] pv = new PropertyValue[1];
            pv[0] = new PropertyValue();
            pv[0].Name = "Wait";
            pv[0].Value = new uno.Any(true);
            xPrint.print(pv);
        }
        catch
        {
            return false;
        }
    }
    return true;
}
Comment 1 jsc 2007-01-10 12:25:31 UTC
We know that OO is not threadsafe and we are working on a solution. Your
described workaround looks fine for me. You can alternatively use mutliple
office instances to print multiple documents in parallel -> server use case. But
this issue is currently not fixable, sorry. A solution is hopefully coming soon.
UNO itself can be threadsafe programmed but the underlying (historical) office
code can't and cause often this kind of problems.
Comment 2 jsc 2009-11-12 10:27:51 UTC
close