A client has our Powerbuilder application (built in version 10.5.2) deployed within a Citrix environment. Something is causing their users to lose the connection to the printer in a pretty random way- there isn't really any rhyme or reason to what's going on in our application, and we're not doing anything (without user input) to change the current Printer or any Printer settings. One minute it works, the next it doesn't. The only thing that causes it to start working again is to go into the Print setup dialog, choose a new printer, then do Print Setup again and change back to your old printer- then it works again. Other applications (non-Powerbuilder) running at the same time don't lose the connection- when the Powerbuilder app can't print, the others still can.
Any ideas? I haven't seen much on the web regarding inconsistent printer problems; most documented problems involve just not being able to print at all, ever. In our situation, it works great... until it doesn't.
We could write code to automatically re-establish the printer connection every time something is supposed to be printed, but we've had issues with instability surrounding those calls in the past. We're hesitant to put a ton of extra calls to printer functions for fear of causing bigger problems (application crashes) than what we're aiming to fix.