I want to cache Excel workbook data as close to having a Workbook object as
possible.  I need it just before as there will be multiple threads writing
data to the cells of the workbook so I want to create a new workbook object
on each cache access.

Here are the options I see.

#1) Store the raw byte[] and pass in an inputstream to
the WorkbookFactory.create() method as this will create a new workbook
instance each time

#2) Store an instance of NPOIFSFileSystem or OPCPackage and use that to
call WorkbookFactory.create()... this will create a new Workbook instance
as well

>From my tests #2 is faster as I assume some pre-parsing is done by the
npiofs and opc classes.  Are the NPOIFSFileSystem and OPCPackage
threadsafe?  (Can I have multiple threads using the same instance in a call
to WorkbookFactory.create()).

#3 ?? Is there a way to hold a Workbook instance in the cache and make a
fast copy of it on each get() call?

Thanks,
Brian.

Reply via email to