Hello,
I have the Web Service method which uploads 100 Mb movie file by 10K chunks.
Code:
public void addFileChunk(Long fileId, byte[] buffer);
I need to store this file in database,
If I were not using Hibernate, I would use the following code which appends each chunk to the end of the LargeObject.
Code:
LargeObject largeObject = largeObjectManager.Open(fileId, LargeObjectManager.READWRITE);
int size = largeObject.Size();
largeObject.Seek(size);
largeObject.Write(buffer);
largeObject.Close();
I'm curious how can I achieve the same functionality using Hibernate persistence objects?
What might be correct methodology to store files by chunk in database?