Archive

Posts Tagged ‘Source Control’

Undo checkout of team member in Enterprise Architect

February 27th, 2010 raymondr No comments

At my current project we use Enterprise Architect. The data of EA is stored in a MS SQL Server. For source control purposes we use Team Foundation Server Source Control. When you perform a check out, the package gets an exclusive lock.

Yesterday, I wanted to change a model in EA, and found out the package was checked out by a team member just before he went on holiday. Unfortunaly, EA doesn’t support undo checkout operations for files checked out by other users. You will need the tools off your source control implementation. To perform a undo check out in Team Foundation Server you need the command line took TF.exe.

First lookup the filename of the xml file of the package under source control to find the userid and workspacename and perform the undo checkout in TFS.

tf.exe undo /workspace:[workspacename];[userid] /s:http://[TFSServer]:8080Â
"$/pathinTFS"

I was expecting I would be able to checkout the package, unfortunaly I got the same error message: “The package is checked out by another user”

Damn, the checkout information is not only stored in Source Control, the information is also stored in the EA repository.

How to undo this in the EA repository?

First lookup the package in the database. Select your favorit database query tool and execute this query:

SELECT	Package_ID, Name, PackageFlags
FROM	t_package
WHERE	Packageflags like '%CheckedOutTo%'

You will get a result with the currently checked out packages. In the field PackageFlags you find the information about the checkout.

VCCFG=<SourcontrolConfigName>;CheckedOutOffline=0;CheckedOutTo=<UserId>;

To undo the checkout, update the package without the CheckedOutTo information:

BEGIN TRAN
UPDATE	t_package
SET	PackageFlags = 'VCCFG=<SourceControlConfigName>;CheckedOutOffline=0;'
WHERE	Package_ID=<YOUR PACKAGE ID>
COMMIT

For safety, select the query above without the commit. If only one record is changed perform the commit, else abort.

Now, go back to Enterprise Architect and checkout the package.