Book a Demo

Author Topic: Deleting wrong record in t_seclocks  (Read 5189 times)

wzr

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Deleting wrong record in t_seclocks
« on: February 19, 2022, 10:28:42 pm »
Hello,

when I'm transfering our DB from MSSQL-Server to a local eapx file i'm always getting an error message, saying that there is an entry in t_seclocks with an empty entity id. The transfer is still completing successfully, but the message annoying.

The result for the following query is exactly one row
Code: [Select]
SELECT *
from t_seclocks
where t_seclocks.EntityID = ''

Since this entry doesnt make any sense to me at all, I'm thinking of deleting this row by using the API:
Code: [Select]
Repository.Execute("DELETE from t_seclocks where t_seclocks.EntityID = '' ")
Do you see a chance that this will harm our model in any way?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Deleting wrong record in t_seclocks
« Reply #1 on: February 20, 2022, 12:28:12 am »
You should probably rather run a consitency check to do that for you.

q.

wzr

  • EA User
  • **
  • Posts: 29
  • Karma: +0/-0
    • View Profile
Re: Deleting wrong record in t_seclocks
« Reply #2 on: February 21, 2022, 08:43:22 pm »
What consistency check do you mean and how to run it?

Configure -> Model -> Integrity -> Project Integrity doesn't report this point.

Thank you!

wivel

  • EA User
  • **
  • Posts: 243
  • Karma: +12/-1
  • Driven by Models
    • View Profile
Re: Deleting wrong record in t_seclocks
« Reply #3 on: February 22, 2022, 03:49:09 am »
It seems to me that Consistensy Check does more behind the scenes, than what it reports, so you might be in luck, that the t_seclocks will be fixed anyway. I would try that out before deleting anything directly in the database.

That being said, Entity_ID should never be empty, so something is not right. If Consistency doesn't fix it, I would:
1. Backup the database using e.g. SQL Server Management Studio (its really fast)
2. Delete the t_seclocks row in error
3. Export again to an EAP(X) file

If something breaks, you can always roll back the database again.

Henrik
 

 

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Deleting wrong record in t_seclocks
« Reply #4 on: February 22, 2022, 04:30:41 am »
Well, as he said. You could as well run a repository.exececute("DELETE FROM ....") to get rid of the records. Given you have the backup in any case...

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Deleting wrong record in t_seclocks
« Reply #5 on: February 22, 2022, 09:17:38 am »
It seems to me that Consistensy Check does more behind the scenes, than what it reports
What gives you that belief?

The 'Report Only' action does not modify the database in any way.

The 'Recover/Clean' action only performs the 'Proposed Action' for each item from the report.

wivel

  • EA User
  • **
  • Posts: 243
  • Karma: +12/-1
  • Driven by Models
    • View Profile
Re: Deleting wrong record in t_seclocks
« Reply #6 on: February 22, 2022, 09:21:04 pm »
Hi Eve

Could that my not so reliable memory that is at play now. Years back on EA 6 or 7, i seem to recall we had an issue with not being able to Tagged Values on an element, that got fixed by doing a Consistency Check, even when the report said no errors.

It is a long time ago, so again, could be I'm wrong.

Henrik

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Deleting wrong record in t_seclocks
« Reply #7 on: February 22, 2022, 09:25:11 pm »
In any case the consistency check only puts out black smoke. None of the messages is really helpful to the user. There should be a log with details and possible explanations for the cause of the errors.

Just dreaming...

q.