Hi there,
I wonder what my options are to read in a remote file (on client side) and store that in database as BLOB. I need to do this all in
EJB. I know that there are better ways to do that than EJB, but that allows me to use existing EJB transaction & security framework.
The only option I could think of is a stateful session bean, which holds on to an Oracle BLOB object and its OutputStream object. The client keeps calling on the EJB method, sending a block of bytes each time, and the stateful session bean keeps writing these bytes into BLOB. My worry is that how do I make sure that the BLOB and OutputStream object are GCed, I could put them in ejbRemove(), but that is not ganranteed to be called.
I also thought about network I/O, but not sure how to use that in EJB, since I do not want to create any socket (I may not have permission to open a port on server).
Any suggestions?
Thanks.
Yan