Author Topic: Locked Packages not visible  (Read 496 times)

tf

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Locked Packages not visible
« on: August 17, 2017, 10:57:48 pm »
Hi all,

Trying to delete a package I get an error message stating the package or items within the package are locked. There are no lock indicators at this package and it doesn't appear in the "Manage Locks" Window. I queried the t_seclocks table in the database, too, and the package is not in the table.

Any idaes how I can find out who locked the package or unlock it?

Thanks, Tony

qwerty

  • EA Guru
  • *****
  • Posts: 8967
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Re: Locked Packages not visible
« Reply #1 on: August 18, 2017, 12:57:38 am »
No idea, except you should run the integrity check.

q.

VKN

  • EA User
  • **
  • Posts: 157
  • Karma: +8/-0
    • View Profile
Re: Locked Packages not visible
« Reply #2 on: August 21, 2017, 02:10:35 pm »
They could be the elements present only on diagrams like Note, Boundary, etc.
You should be able to verify that those elements on the diagrams won't be editable.
Only the person who created can unlock them.
Sparx has confirmed this as a bug.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1072
  • Karma: +81/-5
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Locked Packages not visible
« Reply #3 on: August 21, 2017, 06:17:25 pm »
The lock mechanism can sometimes get out of sync, especially if combined with version control, reusable assets, or some other function that exports/imports packages as XMI.

IIRC, the problem is a GUID mismatch. The locking mechanism locks by GUID (t_seclocks), and both packages and individual elements can be locked. Each package is represented by both a t_package row and a t_element row. Their GUIDs are supposed to match, but that match can break when something goes wrong during XMI import. When this happens, you're left with ghost locks.

So you should take a look at t_seclocks and verify that all its rows actually refer to valid GUIDs. You should also verify that each supposed package has both a t_package and a t_element row and that their GUIDs match.

Oh, and: the project integrity check doesn't catch this.


/Uffe
My theories are always correct, just apply them to the right reality.

qwerty

  • EA Guru
  • *****
  • Posts: 8967
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Re: Locked Packages not visible
« Reply #4 on: August 21, 2017, 09:23:26 pm »
Oh, and: the project integrity check doesn't catch this.

Hopefully one of the Sparxians catches this one.

q.

tf

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Locked Packages not visible
« Reply #5 on: August 22, 2017, 05:34:46 pm »
Thank's for your tipps!

Integrity check didn't help :(

@Uffe, I checked one of the locked packages. It's contained in the t_package and the t_object (I don't have a t_element table...), GUIDs match. But this package is not in the t_seclocks. "Find in all Diagrams" doesn't show any diagram, the package contains no relationships an no elements within the package.

Can I just delete the rows in the t_package and the t_element or are there other tables referencing to these 2 tables?

Kind regards, Tony

qwerty

  • EA Guru
  • *****
  • Posts: 8967
  • Karma: +136/-123
  • I'm no guru at all
    • View Profile
Re: Locked Packages not visible
« Reply #6 on: August 22, 2017, 06:08:52 pm »
You can delete rows in EA tables. Elements are stored in t_object, not t_element. Any packages/elements will be lost. Once you butchered your model this way you need to run an integrity check. That should repair things like orphans (attributes/operations from deleted elements, elements in diagrams). Orphan elements from deleted packages will be moved to some "lost and found" package created at root.

Backup before doing any of the above. Next time you might have learned to create regular backups.

Personally, I'd send the model to Sparx support so they can find out the issue. Alternatively a complete XML-ex-/import to recreate the model from scratch (not to forget reference data) would probably be a better alternative.

q.

tf

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Locked Packages not visible
« Reply #7 on: August 24, 2017, 08:48:18 pm »
@qwerty, the XMI export is the key to the solution!

Looking at the XMI file of the package export, I saw an exported note, and found it's an orphan. The orhan couldn't be deleted - was locked (but was not in the t_seclocks).
Deleting this note in the t_object made the package "deletable".

Thanks for your help!