jsf - Serialization and streams from database images -
jsf - Serialization and streams from database images -
for web app using jsf makes heavy utilize of images stored in database, planning utilize @applicationscoped object (images may shared among sessions). object have java.util.dictionary
fellow member database id key , instance of internal class value store image , other info associated image. multiple sessions may access same image simultaneously , each can decide image should deleted, otherwise image immutable. new images may added database external process.
my general approach follows:
when image requested, key in dictionary. if not there, load image database , store in dictionary. provide access image caller. when image marked deletion user, set flag in value , exit. other sessions may using image still. when value in dictionary destroyed, delete image in database if marked such.how can ensure marked-for-deletion flag respected when dictionary value destroyed? insofar aware (i relatively new java experienced c++ , other languages) there no explicit object destruction, go out of scope.
jsf serialization
Comments
Post a Comment