Radosław Kukla 2 Napisano 11 Kwietnia Udostępnij Napisano 11 Kwietnia w System.Data.Entity.Core.UpdateException:Cannot insert duplicate key in object 'ModelDanychContainer.ExtensionEntities' Witam Mam problem z aktualizacją bazy danych Poniżej wycienek log z programu i załączony pełny log System.Data.Entity.Core.UpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint 'PK_ExtensionEntities'. Cannot insert duplicate key in object 'ModelDanychContainer.ExtensionEntities'. The duplicate key value is (-98). The statement has been terminated. w System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) w System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) w System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) w System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) w System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() w System.Data.SqlClient.SqlDataReader.get_MetaData() w System.Data.SqlClient.SqlCommand.FinishExecuteReader(SNexo_001 Kancelaria Biegłych Rewidentów Aleksandra Kukla 202404110925.txtqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) w System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) w System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) w System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) w System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) w System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) w System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) w System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.<>c.<Reader>b__6_0(DbCommand t, DbCommandInterceptionContext`1 c) w System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed) w System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext) w System.Data.Entity.Internal.InterceptableDbCommand.ExecuteDbDataReader(CommandBehavior behavior) w System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) w System.Data.Entity.Core.Mapping.Update.Internal.DynamicUpdateCommand.Execute(Dictionary`2 identifierValues, List`1 generatedValues) w System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update() --- Koniec śladu stosu wyjątków wewnętrznych --- w System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update() w System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.<>c.<Update>b__21_0(UpdateTranslator ut) w System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.Update[T](T noChangesResult, Func`2 updateFunction) w System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.Update() w System.Data.Entity.Core.Objects.ObjectContext.<SaveChangesToStore>b__153_0() w System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess) w System.Data.Entity.Core.Objects.ObjectContext.SaveChangesToStore(SaveOptions options, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction) w System.Data.Entity.Core.Objects.ObjectContext.<>c__DisplayClass148_0.<SaveChangesInternal>b__0() w System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation) w System.Data.Entity.Core.Objects.ObjectContext.SaveChangesInternal(SaveOptions options, Boolean executeInExistingTransaction) w System.Data.Entity.Core.Objects.ObjectContext.SaveChanges(SaveOptions options) w InsERT.Mox.DatabaseManagement.EFDataInstaller.SaveChangesCore(ObjectContext ctx, DbConnection alterTableConnection) w InsERT.Mox.DatabaseManagement.EFDataInstaller.Update(EFData data, EFDataManifest previousVersionManifest, String updateTag) w InsERT.Mox.DatabaseManagement.DatabaseManager.UpdateDefaultDataPackage(InstallationPlan plan, String updateTag, Byte[] updateData, Assembly modelAssembly, EFData data) w InsERT.Mox.DatabaseManagement.DatabaseManager.GetUpdateData(InstallationPlan plan, String artifactIdentity, String updateTag, Byte[] updateData) w InsERT.Mox.DatabaseManagement.DatabaseManager.UpdateArtifact(InstallationPlan plan, String artifactIdentity) w InsERT.Mox.DatabaseManagement.DatabaseManager.InstallOrUpdateArtifact(InstallationPlan plan, String artifactIdentity) w InsERT.Mox.DatabaseManagement.DatabaseManager.Install(DatabaseManifest manifest, Boolean asSingleUser) POLISCH CI_AS JEST NA BAZIE DANYCH extension.xlsx Konserwacja bazy danych była robiona Przeglądałem tabele ręcznie i nie widzę dubli Link to postu
Kacper Panek 140 Napisano 12 Kwietnia Udostępnij Napisano 12 Kwietnia w System.Data.Entity.Core.UpdateException:Cannot insert duplicate key in object 'ModelDanychContainer.ExtensionEntities' Dzień dobry, z przesłanych informacji wynika, że wystąpił błąd przy konwersji bazy danych. Co więcej, jest to już druga próba konwersji, z których obie zakończyły się niepowodzeniem. W takim wypadku należy przywrócić kopię bazy danych sprzed tych konwersji i na tak przywróconym podmiocie spróbować ponownie zaktualizować bazę danych. Link to postu
Radosław Kukla 2 Napisano 12 Kwietnia Autor Udostępnij Napisano 12 Kwietnia w System.Data.Entity.Core.UpdateException:Cannot insert duplicate key in object 'ModelDanychContainer.ExtensionEntities' Teraz po przywróceniu i aktualizacji mam taki problem Link to postu
Kacper Panek 140 Napisano 12 Kwietnia Udostępnij Napisano 12 Kwietnia w System.Data.Entity.Core.UpdateException:Cannot insert duplicate key in object 'ModelDanychContainer.ExtensionEntities' Powyższy komunikat pojawia się podczas próby uruchomienia Subiekta na podmiocie o typie "biurowy klienta" – na takich podmiotach nie można uruchomić Subiekta nexo. Proszę się upewnić, że przywrócił i uruchamia Pan prawidłowy podmiot. Link to postu
Radosław Kukla 2 Napisano 12 Kwietnia Autor Udostępnij Napisano 12 Kwietnia w System.Data.Entity.Core.UpdateException:Cannot insert duplicate key in object 'ModelDanychContainer.ExtensionEntities' Problem się zrobił wtedy kiedy przenieśliśmy bazę danych z Subiekta GT na Nexo a na subiekcie GT mama prowadziła biuro rachunkowe Link to postu
Radosław Kukla 2 Napisano 12 Kwietnia Autor Udostępnij Napisano 12 Kwietnia w System.Data.Entity.Core.UpdateException:Cannot insert duplicate key in object 'ModelDanychContainer.ExtensionEntities' Przywróciłem ponownie bazę danych i zaktualizowałem. Problem rozwiązany Link to postu
Polecane posty