I have a problem saving in session entities created for the very first time...
Each entity has a list of steps, and each step a list of values. (I'm using inverses on mappings). Also entities and steps references to master values already in db. So there is a kind of mix of old and new objects.
When I do the first Save I do Session.Save(entity)
and the whole tree is saved in database.
The issue relies in that profiler warns of messages like
Unable to determine if StepValueEntity with assigned identifier ede6a5ee-b4bd-4f67-9c64-11ef85b7d6ff is transient or detached; querying the database. Use explicit Save() or Update() in session to prevent this.
because nhibernate does lots of updates before start to really insert things.
What I'm doign wrong?
I've tried something like iterate each step and value and explicity save it but the same is happening.
Edit:
This is how I do mapping for identity columns, maybe this doesn't give a clue to nhibernate to know about what are new and already persisted entities and I should do it in another way.
Id(x => x.Id).Column("GUID_PIPELINE_STEP_PARAMETER").GeneratedBy.Assigned();
Regards