Description of derby-3354_v1.diff
This patch introduces a new WeakHashMap in EmbedConnection. EmbedBlob and EmbedClob objects references are stored in this
map (objects as key and null as value). Adding entry to locater map is
differed till the first call of getLocater.
This ensures that there is entry of LOB objects in locater map if they are invoked in embedded mode.
As the keys of WeakHashMap doesn't prevents the objects from being
garbage collected, once the lob objects are unreferenced lob objects will
be garbage collected releasing the memory.
During commit/rollback or Connection.close, free is invoked on all the lob
objects from WeakHashMap and the map is cleared.
Added a new attribute lobRefrences of type WeakHashMap.
Added a new method addLOBReference to make an entry in new
Modified clearLOBMapping to use lobRefrences to fetch and invoke free on lob objects instead of lobHashMap.
Modified constructs to call connection.lobRefrences instead of conn.addLOBMapping.
Modified getLocater method to check if the locater value is non zero
before returning and if its zero calling conn.addLOBMapping to make
entry of lob objects and getting locater value.
Calling removeLOBMapping in free method.
Cleanup of temporary file is already being taken care by the finalizer of
LOBStreamControl so I haven't added any new cleanup code for
lang and jdbcapi junit tests running clean with this patch applied. I am running rest of the test suite and will update the results of the same.