I've just discovered that if I get an object from an NHibernate session and change a property on object, NHibernate will automatically update the object on commit without me calling Session.Update(myObj)!

I can see how this could be helpful, but as default behaviour it seems crazy!

Update: I now understand persistence ignorance, so this behaviour is now clearly the preferred option. I'll leave this now embarrassing question here to hopefully help other profane users.

How can I stop this happening? Is this default NHibernate behaviour or something coming from Fluent NHibernate's AutoPersistenceModel?

If there's no way to stop this, what do I do? Unless I'm missing the point this behaviour seems to create a right mess.

I'm using NHibernate 2.0.1.4 and a Fluent NHibernate build from 18/3/2009

Is this guy right with his answer?

I've also read that overriding an Event Listener could be a solution to this. However, IDirtyCheckEventListener.OnDirtyCheck isn't called in this situation. Does anyone know which listener I need to override?

Edit
Report