2 Replies Latest reply on Aug 14, 2009 4:09 AM by tilldreier

    Printing Service with thread unsave drivers

      We are developing a label printing webservice for our company.

      The service gets the data from the request and creates a label with jasper. This is working fine. After that we want to print out the label and here we have the problem that the driver is not thread save. If we have some parallel requests the application crashes.

      So I want to ask you if there is a solution how to make this working? We have now made the printing method singleton, this is working but not really performant. And we created a queuing thread for every printer but this is also not working because the printers are using the same driver. So there must be a solution with multiple processes.

        • 1. Re: Printing Service with thread unsave drivers
          peterj

          How about doing the printing from a Message-Driven Bean (MDB). Have your web service send the label information to a queue and have one MDB per printer reading from the queue (probably same source code, but deployed multiple times - once per printer - each with its own config). Then your web service does not have to wait for the label to print before responding - the print request is asynchronous.

          • 2. Re: Printing Service with thread unsave drivers

            Thank You for your response.
            This could be a good solution, but i think there is still a problem with the printer driver dll which is not working in a multi thread application.