We use a the p:fileUpload widget form primefaces with an upload listener like this:
In the listener method we copy the file content to an byte array on a data class to store it later. The script looks like this:
But after uploading multiple files we get an OutOfMemoryError: Java heap space asked 06.05.2015 at 09:27 SupportIvyTeam ♦♦ |
If you store the whole content of a file into a byte array the whole content is held in the RAM. If the byte array is stored to the Dialog data the data is held until the dialog is closed with the Exit End or the session is destroyed. Normally the session gets only destroyed if the session timeout expires. So that means it is normally not a good idea to store file contents on byte arrays (in RAM). This will lead later or sooner to memory problems. You should store the file again as file on the server. As example:
answered 06.05.2015 at 09:54 Christian St... ♦ SupportIvyTeam ♦♦ The documentation of ch.ivyteam.ivy.scripting.objects.File says: public File(String path, boolean temporary) throws IOException temporary - if true then a temporary file will be created, otherwise a persistent file will be created Question: When will the temporary file be deleted?
(06.05.2015 at 10:24)
HaraldWeber
The temporary file will be removed if the session terminates, normally if the session timeout expires. The session also is closed if the server or designer is closed.
(06.05.2015 at 10:33)
Christian St... ♦
|
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 06.05.2015 at 09:27
Seen: 7,363 times
Last updated: 06.05.2015 at 10:33