Book a Demo

Author Topic: Can a Version Control lock be released?  (Read 13255 times)

shimon

  • EA User
  • **
  • Posts: 172
  • Karma: +6/-0
    • View Profile
Can a Version Control lock be released?
« on: May 11, 2014, 08:34:04 pm »
Using the security within EA, I eas able to release locks of other users. I want to implement Version Control using SVN, but I find no way of releasing a user's lock even if I steal the locks within SVN.
I can write and check in the XMI file that is related to that Package, but within EA it is still locked by the user that checked it out.
Is there no way for an adminitratir to release a lock of a user?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Can a Version Control lock be released?
« Reply #1 on: May 12, 2014, 05:52:01 am »
IIRC the VC / Synch is the only way to get rid of it (after having released the lock with native VC methods).

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Can a Version Control lock be released?
« Reply #2 on: May 12, 2014, 09:05:08 am »
There is a manage locks permission and associated dialog that allows releasing locks owned by other people.

shimon

  • EA User
  • **
  • Posts: 172
  • Karma: +6/-0
    • View Profile
Re: Can a Version Control lock be released?
« Reply #3 on: May 12, 2014, 08:27:22 pm »
Quote
There is a manage locks permission and associated dialog that allows releasing locks owned by other people.


I know about that, but that can only be used if the EA security is being used, not if you're using Version Control.

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Can a Version Control lock be released?
« Reply #4 on: May 12, 2014, 08:33:45 pm »
Try:
Package Control,
Re-synch Status with VC provider

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

shimon

  • EA User
  • **
  • Posts: 172
  • Karma: +6/-0
    • View Profile
Re: Can a Version Control lock be released?
« Reply #5 on: May 12, 2014, 08:39:07 pm »
Quote
IIRC the VC / Synch is the only way to get rid of it (after having released the lock with native VC methods).

q.


This is not enough, as in the EA repository it is still locked. The only way I was able to do this was by manipulating the DB directly and deleting part of the value in the t_Package record "locked by: username".
After that I had to steal and release the locks in VC.
Now I was able to Check-out from another computer.

The only problem was that on the first station from where I did the original Check-out, it is still checked out and I cannot "Undo check out" as the SVN repository is unlocked. So I am stuck there too.
Not a very pretty situation.

I have to give my customer a solution for this, and it won't be pretty.


I guess I'll have my programmer write a script that does all this, but it won't be simple.
« Last Edit: May 12, 2014, 08:43:10 pm by shimonmx »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Can a Version Control lock be released?
« Reply #6 on: May 12, 2014, 09:51:54 pm »
It actually is pretty simple.
I've written an unlock function in C# that does following
Code: [Select]
       /// <summary>
        /// unlocks this element
        /// </summary>
        public override void unLock()
        {
            if (this.isLocked() && !this.isReadOnly())
            {
                this.wrappedElement.ReleaseUserLock();
            }
            //EA doesn't want to release user locks from other users, so we do it directly in the database
            string SQLDeleteLock = @"delete from t_seclocks where EntityID = '" + this.getGUID() + "'";
            ((EAModel)this.model).getWrappedModel().Execute(SQLDeleteLock);

        }
So if it is locked by the current user then we ask the API to release the user lock.
If not I just delete the entry in t_seclocks.

Geert
« Last Edit: May 12, 2014, 09:52:20 pm by Geert.Bellekens »

shimon

  • EA User
  • **
  • Posts: 172
  • Karma: +6/-0
    • View Profile
Re: Can a Version Control lock be released?
« Reply #7 on: May 12, 2014, 11:16:33 pm »
I'm quite sure that when using Version Control, the variable that is checked is "locked by: username" in the t_Package table.
We do have a script to release locks made by EA where the regular Project -> Security -> manage locks don't show the locks.

In the case of Version Control it doesn't work.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Can a Version Control lock be released?
« Reply #8 on: May 13, 2014, 02:57:11 am »
You actually need to release the lock in the VC with a native VC command. Once you have done that you can run the VC / Sync inside EA. The VC locks are not kept inside EA but the VC provider.

q.

shimon

  • EA User
  • **
  • Posts: 172
  • Karma: +6/-0
    • View Profile
Re: Can a Version Control lock be released?
« Reply #9 on: May 14, 2014, 12:45:26 am »
Quote
You actually need to release the lock in the VC with a native VC command. Once you have done that you can run the VC / Sync inside EA. The VC locks are not kept inside EA but the VC provider.

q.


This is true only if the same user locked the EA unit from another location. If another user "Checked out" the package, the lock is registered in EA in addition to in VC.
I mentioned before where the lock is held.

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Can a Version Control lock be released?
« Reply #10 on: May 14, 2014, 04:24:20 am »
As far as only VC is concerned you can solve this by an Addin.

I was sick of jumping between EA and my VC tool (svn). Therefore I wrote an Addin for svn. Now I have all information on my finger tip in EA. To update the EA information of a checked out package is, with the right knowhow, easy. It works also for private repositories.

Working with EA und VC has some nasty issues like:
- Change *.xml file of a versioned controlled package
- Get the user of a checked out package (private repository)
- Get the VC information from the VC Service Provider
- Where are my *.xml files after reorgnisation of my package structure?

Write a change request for some simple functions:
- Rename/Move *.xml file
- Update package flags for checked out packages (privat repositories)
  (the existing function don't properly do the job)
- Show Log of *.xml file (the history)
- Show repository entry of *.xml file
- Show Folder of *.xml file
- With the VCC interface it shouldn't been to complicated

I'have done it for svn.


Helmut



 

Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

shimon

  • EA User
  • **
  • Posts: 172
  • Karma: +6/-0
    • View Profile
Re: Can a Version Control lock be released?
« Reply #11 on: May 25, 2014, 06:04:57 pm »
Quote
As far as only VC is concerned you can solve this by an Addin.

I was sick of jumping between EA and my VC tool (svn). Therefore I wrote an Addin for svn. Now I have all information on my finger tip in EA. To update the EA information of a checked out package is, with the right knowhow, easy. It works also for private repositories.

Working with EA und VC has some nasty issues like:
- Change *.xml file of a versioned controlled package
- Get the user of a checked out package (private repository)
- Get the VC information from the VC Service Provider
- Where are my *.xml files after reorgnisation of my package structure?

Write a change request for some simple functions:
- Rename/Move *.xml file
- Update package flags for checked out packages (privat repositories)
  (the existing function don't properly do the job)
- Show Log of *.xml file (the history)
- Show repository entry of *.xml file
- Show Folder of *.xml file
- With the VCC interface it shouldn't been to complicated

I'have done it for svn.


Helmut



 



Did you post this addin anywhere?
Would you mind sharing it? We ARE using SVN.

« Last Edit: May 25, 2014, 06:05:28 pm by shimonmx »