2016-04-15 18:45:09,214 [84] NHibernate.AssertionFailure - (null) - An AssertionFailure occurred - this may indicate a bug in NHibernate or in your custom types. [(null)]
NHibernate.AssertionFailure: null id in Orchard.Tasks.Locking.Records.DistributedLockRecord entry (don't flush the Session after an exception occurs)
2016-04-15 18:45:09,242 [84] Orchard.Tasks.Locking.Services.DistributedLockService - (null) - An error occurred while trying to acquire lock 'DistributedLock:RealEstateWorld:Orchard.JobsQueue.Services.JobsQueueProcessor'. [(null)]
NHibernate.AssertionFailure: null id in Orchard.Tasks.Locking.Records.DistributedLockRecord entry (don't flush the Session after an exception occurs)
at NHibernate.Event.Default.DefaultFlushEntityEventListener.CheckId(Object obj, IEntityPersister persister, Object id, EntityMode entityMode)
at NHibernate.Event.Default.DefaultFlushEntityEventListener.GetValues(Object entity, EntityEntry entry, EntityMode entityMode, Boolean mightBeDirty, ISessionImplementor session)
at NHibernate.Event.Default.DefaultFlushEntityEventListener.OnFlushEntity(FlushEntityEvent event)
at NHibernate.Event.Default.AbstractFlushingEventListener.FlushEntities(FlushEvent event)
at NHibernate.Event.Default.AbstractFlushingEventListener.FlushEverythingToExecutions(FlushEvent event)
at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)
at NHibernate.Impl.SessionImpl.Flush()
at NHibernate.Transaction.AdoTransaction.Commit()
at Orchard.Data.TransactionManager.DisposeSession() in C:\Users\andy\Documents\orchard110house-zg\Orchard1203\Orchard\src\Orchard\Data\SessionLocator.cs:line 96
at Orchard.Data.TransactionManager.Dispose() in C:\Users\andy\Documents\orchard110house-zg\Orchard1203\Orchard\src\Orchard\Data\SessionLocator.cs:line 86
at Autofac.Core.Disposer.Dispose(Boolean disposing)
at Autofac.Util.Disposable.Dispose()
at Autofac.Core.Lifetime.LifetimeScope.Dispose(Boolean disposing)
at Autofac.Util.Disposable.Dispose()
at Orchard.Tasks.Locking.Services.DistributedLockService.ExecuteOnSeparateTransaction(Action`1 action) in C:\Users\andy\Documents\orchard110house-zg\Orchard1203\Orchard\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 215
at Orchard.Tasks.Locking.Services.DistributedLockService.EnsureDistributedLockRecord(String internalName, Nullable`1 maxValidFor) in C:\Users\andy\Documents\orchard110house-zg\Orchard1203\Orchard\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 142
at Orchard.Tasks.Locking.Services.DistributedLockService.<>c__DisplayClass9_1.<AcquireLockInternal>b__0() in C:\Users\andy\Documents\orchard110house-zg\Orchard1203\Orchard\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 103
at Orchard.Tasks.Locking.Services.DistributedLockService.RepeatUntilTimeout(Nullable`1 timeout, TimeSpan repeatInterval, Func`1 action) in C:\Users\andy\Documents\orchard110house-zg\Orchard1203\Orchard\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 198
at Orchard.Tasks.Locking.Services.DistributedLockService.AcquireLockInternal(String name, Nullable`1 maxValidFor, Nullable`1 timeout, Boolean throwOnTimeout) in C:\Users\andy\Documents\orchard110house-zg\Orchard1203\Orchard\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 102
2016-04-15 18:45:09,263 [84] Orchard.Tasks.Locking.Services.DistributedLockService - (null) - Error while trying to acquire lock 'Orchard.JobsQueue.Services.JobsQueueProcessor'. [(null)]
NHibernate.AssertionFailure: null id in Orchard.Tasks.Locking.Records.DistributedLockRecord entry (don't flush the Session after an exception occurs)
at NHibernate.Event.Default.DefaultFlushEntityEventListener.CheckId(Object obj, IEntityPersister persister, Object id, EntityMode entityMode)
at NHibernate.Event.Default.DefaultFlushEntityEventListener.GetValues(Object entity, EntityEntry entry, EntityMode entityMode, Boolean mightBeDirty, ISessionImplementor session)
at NHibernate.Event.Default.DefaultFlushEntityEventListener.OnFlushEntity(FlushEntityEvent event)
at NHibernate.Event.Default.AbstractFlushingEventListener.FlushEntities(FlushEvent event)
at NHibernate.Event.Default.AbstractFlushingEventListener.FlushEverythingToExecutions(FlushEvent event)
at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)
at NHibernate.Impl.SessionImpl.Flush()
at NHibernate.Transaction.AdoTransaction.Commit()
at Orchard.Data.TransactionManager.DisposeSession() in C:\Users\andy\Documents\orchard110house-zg\Orchard1203\Orchard\src\Orchard\Data\SessionLocator.cs:line 96
at Orchard.Data.TransactionManager.Dispose() in C:\Users\andy\Documents\orchard110house-zg\Orchard1203\Orchard\src\Orchard\Data\SessionLocator.cs:line 86
at Autofac.Core.Disposer.Dispose(Boolean disposing)
at Autofac.Util.Disposable.Dispose()
at Autofac.Core.Lifetime.LifetimeScope.Dispose(Boolean disposing)
at Autofac.Util.Disposable.Dispose()
at Orchard.Tasks.Locking.Services.DistributedLockService.ExecuteOnSeparateTransaction(Action`1 action) in C:\Users\andy\Documents\orchard110house-zg\Orchard1203\Orchard\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 215
at Orchard.Tasks.Locking.Services.DistributedLockService.EnsureDistributedLockRecord(String internalName, Nullable`1 maxValidFor) in C:\Users\andy\Documents\orchard110house-zg\Orchard1203\Orchard\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 142
at Orchard.Tasks.Locking.Services.DistributedLockService.<>c__DisplayClass9_1.<AcquireLockInternal>b__0() in C:\Users\andy\Documents\orchard110house-zg\Orchard1203\Orchard\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 103
at Orchard.Tasks.Locking.Services.DistributedLockService.RepeatUntilTimeout(Nullable`1 timeout, TimeSpan repeatInterval, Func`1 action) in C:\Users\andy\Documents\orchard110house-zg\Orchard1203\Orchard\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 198
at Orchard.Tasks.Locking.Services.DistributedLockService.AcquireLockInternal(String name, Nullable`1 maxValidFor, Nullable`1 timeout, Boolean throwOnTimeout) in C:\Users\andy\Documents\orchard110house-zg\Orchard1203\Orchard\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 134
at Orchard.Tasks.Locking.Services.DistributedLockService.TryAcquireLock(String name, Nullable`1 maxValidFor, Nullable`1 timeout, IDistributedLock& dLock) in C:\Users\andy\Documents\orchard110house-zg\Orchard1203\Orchard\src\Orchard\Tasks\Locking\Services\DistributedLockService.cs:line 42
so this give me a idea: Can we create AddOrUpdate method on IRepository<> ?