Le 11/10/2012 15:31, Timo Boehme a écrit :
No, there is no close() in the process. But the process is runing inside
a threaded environnement; the File.createTempFile seems thread safe, but
I do not trust the Weblogic jvm…
The problem is : how to check if :
* the file is deleted by the java process
* the file is deleted by the environemnt (cron job, another
application)
* the file has never existed
You should use a temporary directory which you can control. JavaVM won't
delete the file even if it is created as temp file.
Failing to create the temp file would result in a different exception.
PDFBox is not thread safe. Each thread needs its own instance. Thus
processing a document should be done in a single thread but you can
process multiple documents in parallel with one instance per thread.
We are actualy in the case where each pdfbox instance run in its own
instance.
I'll try to compile my own package of pdfbox where I log each call to
the close() method. We'll quickly see if the file is deleted inside the
jvm, or by an external process. (The finalize() is not called as we
don't see the warning message).
Thanks for your help, i'll keep you informed !
--
Sébastien Dailly