This will clear your cashe for all objects:
Code:
session.Clear();
So next time you load any object associated with this session it, it will be loaded directly from DB.
If you want to only to reload specific object (and don't clear whole cashe) use:
Code:
session.Refresh(item);
But i think, in your case you have changed PK or inserted object with the same ID.
You could try, remove your "item" from session
Code:
session.Evict(item);
before saving it with non-hibernate code, but probably DB will throw exception.
So it is not good idea to change ID of proxy objects.
Hope it helps a little bit.