Loading ...
Sorry, an error occurred while loading the content.

Re: [XSL-FO] Re: Blank page on pdf download and general question

Expand Messages
  • J.Pietschmann
    ... This is not thread safe. The file might be written by several threads. Also, an incompletely rendered file might be read. You ll have to check on a
    Message 1 of 6 , Dec 10, 2003
    • 0 Attachment
      Ivan wrote:
      > Why save the file to disk?Because the process is:
      > -checks if the file is present
      > -if so, let's serve the file
      > -if it doesn't, let's transform the file and serve it.
      >
      > This is due as the transformation process takes a little bit longer.

      This is not thread safe. The file might be written by several
      threads. Also, an incompletely rendered file might be read.

      You'll have to check on a synchronized hash map or something
      whether rendering for a certain URL is in progress, and somehow
      wait for it to finish before accessing the file. This is tricky.
      A simpler alternative is:
      a) No rendering active and no file: render to file, then serve the
      file
      B) No rendering active but there is a file: serve the file
      C) Rendering active: render to byte array and serve the byte array
      (the byte array is needed to set the content length in order to
      circumvent an IEx bug)

      If the dcontent for the URLs is dynamic, you have to put more thought
      into the whole concept.

      The PrintRenderer isn't thread safe either. Use with care.

      J.Pietschmann
    Your message has been successfully submitted and would be delivered to recipients shortly.