Objects of my class keep information retrieved from external database. There is a column of CLOB type in database, it has 1M size. I don't want objects save that in memory. So I keep in object's field only path to local file where information is saved. But I don't want this file to be persistent. I want it to be deleted after the object is destroyed by garbage collector. How to implement this in Java? I guess my class should extend some other specific class and then override a method where I explicitly delete a file.
UPD: I'm making a dynamic webapp, using Java servlets and Apache Tomcat. This webapp works with external db. Webapp runs on Linux. It has some sort of layered architecture, using domain, stores and servlets. The lifecycle of an object described above is simply duration of invocation of doGet() or doPost() methods in a servlet.