public void finishTranslationUnit() {
m_session.commit();
ArrayList entries=new ArrayList();
for ( IndexIterator ii=m_session.greaterThanOrEqualEntries(
UnitEntry.UNIT_INDEX_NAME,
new ObjectRefKey( m_unit));
ii.hasNext() && ii.isExactMatch();)
{
entries.add( ii.next());
}
HashSet possible_clear=new HashSet();
for ( Iterator i=entries.iterator(); i.hasNext();)
((UnitEntry)i.next()).clearIfObsolete( possible_clear);
entries=null;
for ( Iterator i=possible_clear.iterator(); i.hasNext();)
{
Persistent p=(Persistent)((ObjectRef)i.next()).getReferenced();
if ( ! m_session.greaterThanOrEqualEntries( UnitEntry.ENTRY_INDEX_NAME,
new ObjectRefKey(p)).isExactMatch())
m_session.deleteObject( p);
}
m_session.commit();
}