clear session while reindexing database

While reindexing bit tables, the heap is getting filled continuously. This is because Hibernate stores the objects in its cache so they cannot be garbage collected. In order to prevent this problem, the cache should get cleared out while reindexing.