Database Integrity Suggestion
Question
Application Type
Reactive

Hello. So today i edited my table from the database, changed a few column names and types...
Now i am getting errors, saying that the old attributes exists but there is no corresponding in entity...

I think this is also messing up with the create function of the entity.. How can i workaround this?

Any help is appreciated :)

Hello Ricardo,

In databases, when we change the name of an attribute, a new attribute is created, when only the type is changed, a new attribute is not created. For those cases where an attribute with the new name was created and the old one was saved in the database, you can use DBCleaner.

 https://www.outsystems.com/forge/component-overview/423/dbcleaner 

Regards,

Jorge Rodrigues

I dont have access to deleting tables attributes with that component.. other way possible?

If you are still at the beginning and you don't have many implications, I would suggest that you copy the table in question and paste it to create a new table and then delete the old one. Take care to leave the table with the same name and not the table2 genus.

Well, i created another table with a diferent name and copy/pasted the attributes into that one. Deleted the old table.
Now i got this error:

Internal Error


An error occurred in task 'Loading eSpace with key 'f24cf3fa-ad6f-4476-a303-f60846b44ab5'':

Object not found: /AnonymousStructures.Zb1vVamDOkG5qL5oki+D1g (relativeTo: null)

Details : System.InvalidOperationException: Object not found: /AnonymousStructures.Zb1vVamDOkG5qL5oki+D1g (relativeTo: null)

   at OutSystems.HubEdition.Compiler.CompoundKeyResolver.GetObject(CompoundKey key, AbstractObject relativeTo)

   at OutSystems.HubEdition.Compiler.Expressions.AbstractObjectExpression.get__expressionType()

   at OutSystems.HubEdition.Compiler.Expressions.AbstractObjectExpression.AfterLoad()

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.LoadObjectExpression(AbstractObject parent, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.LoadExpression(AbstractObject parent, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.Argument.LoadChildren(ESpaceReader reader)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.InnerLoadChildren[Type](AbstractObject parent, CollectionIndex collectionIndex, ICompilerCollection`1 collection)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.LoadChildren[Type](AbstractObject parent, ICompilerSequence`1& collection, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.InnerLoadChildren[Type](AbstractObject parent, CollectionIndex collectionIndex, ICompilerCollection`1 collection)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.LazyLoadChildren[Type](AbstractObject parent, ICompilerSequence`1& collection, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.AbstractObject.EnsureCacheableCollectionIsLoaded[TType](ICompilerSequence`1& collection, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.AbstractFlow.get_Nodes()

   at OutSystems.HubEdition.Compiler.Flows.AbstractActionFlow.LoadAssertComments()

   at OutSystems.HubEdition.Compiler.Flows.AbstractActionFlow.AfterLoad()

   at OutSystems.HubEdition.Compiler.Flows.AbstractUserAction.AfterLoad()

   at OutSystems.RuntimeCommon.CollectionsExtensions.Apply[Type](IEnumerable`1 collection, Action`1 action)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.InnerLoadChildren[Type](AbstractObject parent, CollectionIndex collectionIndex, ICompilerCollection`1 collection)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.LazyLoadChildren[Type](AbstractObject parent, ICompilerSequence`1& collection, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.AbstractObject.EnsureCacheableCollectionIsLoaded[TType](ICompilerSequence`1& collection, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.ESpace.GetChildCollection(CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.CompoundKeyResolver.GetObjectResolver.Visit(ChildCompoundKey childCompoundKey)

   at OutSystems.HubEdition.Compiler.CompoundKeyResolver.TryGetObject(CompoundKey key, AbstractObject relativeTo)

   at OutSystems.HubEdition.Compiler.CompoundKeyResolver.GetObject(CompoundKey key, AbstractObject relativeTo)

   at OutSystems.HubEdition.Compiler.CompilationResult.GetCompiledObject(CompoundKey compoundKey)

   at OutSystems.HubEdition.Compiler.CompilationResult.AfterESpaceLoad()

   at OutSystems.HubEdition.Compiler.ESpace..ctor(Oml oml, CompilationContext context, Boolean loadModelOnly)

   at OutSystems.HubEdition.Compiler.Compiler.LoadEspace(CompilationContext context, Oml oml, Boolean allowInvalid)

   at cs#mblrkcgj.Execute(cs#mblrkcgi input, IMessageBroker messageBroker, IESpace& eSpace)

   at OutSystems.Server.Infrastructure.Tasks.AbstractTask`1.InnerRun(InputType input, IMessageBroker messageBroker, Func`1 executeAction)


Exception Details:

[1] Internal Error: An error occurred in task 'Loading eSpace with key 'f24cf3fa-ad6f-4476-a303-f60846b44ab5'':

Object not found: /AnonymousStructures.Zb1vVamDOkG5qL5oki+D1g (relativeTo: null)

Details : System.InvalidOperationException: Object not found: /AnonymousStructures.Zb1vVamDOkG5qL5oki+D1g (relativeTo: null)

   at OutSystems.HubEdition.Compiler.CompoundKeyResolver.GetObject(CompoundKey key, AbstractObject relativeTo)

   at OutSystems.HubEdition.Compiler.Expressions.AbstractObjectExpression.get__expressionType()

   at OutSystems.HubEdition.Compiler.Expressions.AbstractObjectExpression.AfterLoad()

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.LoadObjectExpression(AbstractObject parent, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.LoadExpression(AbstractObject parent, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.Argument.LoadChildren(ESpaceReader reader)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.InnerLoadChildren[Type](AbstractObject parent, CollectionIndex collectionIndex, ICompilerCollection`1 collection)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.LoadChildren[Type](AbstractObject parent, ICompilerSequence`1& collection, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.InnerLoadChildren[Type](AbstractObject parent, CollectionIndex collectionIndex, ICompilerCollection`1 collection)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.LazyLoadChildren[Type](AbstractObject parent, ICompilerSequence`1& collection, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.AbstractObject.EnsureCacheableCollectionIsLoaded[TType](ICompilerSequence`1& collection, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.AbstractFlow.get_Nodes()

   at OutSystems.HubEdition.Compiler.Flows.AbstractActionFlow.LoadAssertComments()

   at OutSystems.HubEdition.Compiler.Flows.AbstractActionFlow.AfterLoad()

   at OutSystems.HubEdition.Compiler.Flows.AbstractUserAction.AfterLoad()

   at OutSystems.RuntimeCommon.CollectionsExtensions.Apply[Type](IEnumerable`1 collection, Action`1 action)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.InnerLoadChildren[Type](AbstractObject parent, CollectionIndex collectionIndex, ICompilerCollection`1 collection)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.LazyLoadChildren[Type](AbstractObject parent, ICompilerSequence`1& collection, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.AbstractObject.EnsureCacheableCollectionIsLoaded[TType](ICompilerSequence`1& collection, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.ESpace.GetChildCollection(CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.CompoundKeyResolver.GetObjectResolver.Visit(ChildCompoundKey childCompoundKey)

   at OutSystems.HubEdition.Compiler.CompoundKeyResolver.TryGetObject(CompoundKey key, AbstractObject relativeTo)

   at OutSystems.HubEdition.Compiler.CompoundKeyResolver.GetObject(CompoundKey key, AbstractObject relativeTo)

   at OutSystems.HubEdition.Compiler.CompilationResult.GetCompiledObject(CompoundKey compoundKey)

   at OutSystems.HubEdition.Compiler.CompilationResult.AfterESpaceLoad()

   at OutSystems.HubEdition.Compiler.ESpace..ctor(Oml oml, CompilationContext context, Boolean loadModelOnly)

   at OutSystems.HubEdition.Compiler.Compiler.LoadEspace(CompilationContext context, Oml oml, Boolean allowInvalid)

   at cs#mblrkcgj.Execute(cs#mblrkcgi input, IMessageBroker messageBroker, IESpace& eSpace)

   at OutSystems.Server.Infrastructure.Tasks.AbstractTask`1.InnerRun(InputType input, IMessageBroker messageBroker, Func`1 executeAction)

at OutSystems.Server.Infrastructure.Tasks.AbstractTask`1.InnerRun(InputType input, IMessageBroker messageBroker, Func`1 executeAction)

   at OutSystems.Server.Infrastructure.Tasks.AbstractTask`2.Run(InputType input, IMessageBroker messageBroker, OutputType& result)

   at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()

   at System.Threading.Tasks.Task.Execute()

   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)

   at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)

   at System.Threading.ThreadPoolWorkQueue.Dispatch()

[2] System.InvalidOperationException: Object not found: /AnonymousStructures.Zb1vVamDOkG5qL5oki+D1g (relativeTo: null)

   at OutSystems.HubEdition.Compiler.CompoundKeyResolver.GetObject(CompoundKey key, AbstractObject relativeTo)

   at OutSystems.HubEdition.Compiler.Expressions.AbstractObjectExpression.get__expressionType()

   at OutSystems.HubEdition.Compiler.Expressions.AbstractObjectExpression.AfterLoad()

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.LoadObjectExpression(AbstractObject parent, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.LoadExpression(AbstractObject parent, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.Argument.LoadChildren(ESpaceReader reader)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.InnerLoadChildren[Type](AbstractObject parent, CollectionIndex collectionIndex, ICompilerCollection`1 collection)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.LoadChildren[Type](AbstractObject parent, ICompilerSequence`1& collection, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.InnerLoadChildren[Type](AbstractObject parent, CollectionIndex collectionIndex, ICompilerCollection`1 collection)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.LazyLoadChildren[Type](AbstractObject parent, ICompilerSequence`1& collection, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.AbstractObject.EnsureCacheableCollectionIsLoaded[TType](ICompilerSequence`1& collection, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.AbstractFlow.get_Nodes()

   at OutSystems.HubEdition.Compiler.Flows.AbstractActionFlow.LoadAssertComments()

   at OutSystems.HubEdition.Compiler.Flows.AbstractActionFlow.AfterLoad()

   at OutSystems.HubEdition.Compiler.Flows.AbstractUserAction.AfterLoad()

   at OutSystems.RuntimeCommon.CollectionsExtensions.Apply[Type](IEnumerable`1 collection, Action`1 action)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.InnerLoadChildren[Type](AbstractObject parent, CollectionIndex collectionIndex, ICompilerCollection`1 collection)

   at OutSystems.HubEdition.Compiler.Serialization.ESpaceReader.LazyLoadChildren[Type](AbstractObject parent, ICompilerSequence`1& collection, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.AbstractObject.EnsureCacheableCollectionIsLoaded[TType](ICompilerSequence`1& collection, CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.ESpace.GetChildCollection(CollectionIndex collectionIndex)

   at OutSystems.HubEdition.Compiler.CompoundKeyResolver.GetObjectResolver.Visit(ChildCompoundKey childCompoundKey)

   at OutSystems.HubEdition.Compiler.CompoundKeyResolver.TryGetObject(CompoundKey key, AbstractObject relativeTo)

   at OutSystems.HubEdition.Compiler.CompoundKeyResolver.GetObject(CompoundKey key, AbstractObject relativeTo)

   at OutSystems.HubEdition.Compiler.CompilationResult.GetCompiledObject(CompoundKey compoundKey)

   at OutSystems.HubEdition.Compiler.CompilationResult.AfterESpaceLoad()

   at OutSystems.HubEdition.Compiler.ESpace..ctor(Oml oml, CompilationContext context, Boolean loadModelOnly)

   at OutSystems.HubEdition.Compiler.Compiler.LoadEspace(CompilationContext context, Oml oml, Boolean allowInvalid)

   at cs#mblrkcgj.Execute(cs#mblrkcgi input, IMessageBroker messageBroker, IESpace& eSpace)

   at OutSystems.Server.Infrastructure.Tasks.AbstractTask`1.InnerRun(InputType input, IMessageBroker messageBroker, Func`1 executeAction)


Why?

Hello Ricardo, 

Hope You are Doing Well...!

Here I am attaching the link for your reference. You can find here how to resolve this error. 

https://success.outsystems.com/Documentation/11/Reference/Errors_and_Warnings/Warnings/Database_Integrity_Suggestion_Warning


Please let me know if you need more help with it.


All The Best.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.