Bug 68387 - Issue with adding photos when working concurrently with SXSSFWorkbook.
Summary: Issue with adding photos when working concurrently with SXSSFWorkbook.
Status: RESOLVED WONTFIX
Alias: None
Product: POI
Classification: Unclassified
Component: SXSSF (show other bugs)
Version: 5.2.2-FINAL
Hardware: PC Mac OS X 10.1
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-21 21:10 UTC by Alex
Modified: 2024-02-25 12:35 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex 2023-12-21 21:10:58 UTC
Issue pertains to a possible problem with the method `public int addPicture(byte[] pictureData, int format)` when used in conjunction with the implementation of XSSFWorkbook, where the field `private List<XSSFPictureData> pictures` is not thread-safe.

Ideally, there should be a convenient way to add photos while working in multiple threads, for example, by creating a method that takes Sheet, ClientAnchor, and BufferedImage as parameters.

Platform Java 17
apache.poi.version - 5.2.5
Comment 1 Dominik Stadler 2024-02-25 12:35:03 UTC
See item "20. Can I access/modify workbooks/documents/slideshows in multiple threads?" in the FAQ at https://poi.apache.org/help/faq.html

"In short: Handling different document-objects in different threads will work. Accessing the same document in multiple threads will not work."

Feel free to suggest PRs, but keep in mind that we do not plan to allow to process a single workbook object in multiple threads as it is very hard to do correctly and it would likely degrade performance when processing very large files.