poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Murphy, Mark" <murphym...@metalexmfg.com>
Subject RE: How to "clone" values of a workbook
Date Wed, 11 May 2016 14:19:32 GMT
I am trying to understand just what it is you are trying to do

>> because the creation of workbook instances is pretty costly (about 200ms to 15 seconds
for the workbooks we are dealing with) we implemented a pooling of workbook instances which
seems to work pretty well.

What do you mean by this? How does it work?

>> Since we are only performing limited write-operations on the workbook instances (basically
only calling Cell.setCellType() and Cell.setCellValue()) we need a way of "cloning" the original
workbook values when retrieving a workbook instance from the pool, remembering them and "reseting"
the workbook instance when returning it to the pool by setting all those remembered values
to the workbook instance.

Are you holding a group of workbooks in memory, then using them as templates to write new
workbooks with changed values? Or are you changing the values and saving it with a new file
name?

>> I'm wondering if there is already a functionality like this in poi or if somebody
already did sth. similar? Otherwhise I'll have to write sth. by my own (which shouldn't be
too hard) - but I thought that I'll ask anyway.

>> Performing a deep clone of the complete workbook is not an option as this would make
the whole pooling idea pointless.

It may be possible to write your new workbook using SXSSF which does not hold everything in
memory so long. You can specify how many rows to keep in memory to help control the amount
of memory used.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Mime
View raw message