code: public void cleanup(boolean reuse, boolean wasInsert)
      {
          if(currentImage != null)
          {
              performImageCleanup(currentImage, reuse);
          }
          if(beforeImage != null)
          {
              // we always free all resources of the old image
              performImageCleanup(beforeImage, false);
          }
          if(reuse)
          {
              refreshObjectImage(wasInsert);
          }
          else
          {
              myObj = null;
          }
      }
docs: This method should be called before transaction ends
  to allow cleanup of used resources, e.g. remove proxy listener objects
  to avoid invoke of registered objects after tx end.