Page 1 of 1

Gold R6 Transient or Detached error in App.Log

Posted: Wed Apr 02, 2014 7:04 pm
by AbleMods
Gold R6 app.log file is showing hundreds of this error:
2014-04-02 22:10:48,173 WARN e.Engine.ForeignKeys Unable to determine if CommerceBuilder.Users.UserGroup with assigned identifier CommerceBuilder.Users.UserGroupKey is transient or detached; querying the database. Use explicit Save() or Update() in session to prevent this.
Is this bad? Good? Can be ignored?

Re: Gold R6 Transient or Detached error in App.Log

Posted: Thu Apr 03, 2014 1:59 am
by ForumsAdmin
The short answer is - It can be ignored.

The long answer is that NHibernate does not like composite keys. In fact use of composite keys is discouraged in object relational mapping frameworks. When there are composite keys in use NHibernate can not easily determine which associated objects are to be saved when an entity is saved and therefore it may make additional calls to the database.
The recommended solution is to eliminate the composite keys and make use of identity keys. We do have an improvement logged in our bug database for this purpose. However since this kind of change is not easy to make especially taking into consideration the impact on upgrades, we have so far kept this improvement unscheduled for a near future release.