castrojas
Member
Reged: 08/24/07
Posts: 28
|
|
Hi all,
one of my QTP user hits the message "this test is locked by another quality center user" "it will open is Read-only mode" Actually no other user is opened the test in Edit mode, I confirmed this via site admin user connection sessions Any idea why its happens, are there any setting in QTP/QC to avoid this problem
Thanks all
|
Tony Davis
Veteran
Reged: 03/23/00
Posts: 3082
Loc: Orange County, CA
|
|
you might need to look in the LOCK table for the project to see if there is an orphan entry that needs to be removed for the test.
Get the test ID that is reporting as locked, then just query the table to see if that test is there (I lay odds it is), then all you need to do is delete that entry in the table.
-------------------- Insanity: doing the same thing over and over again and expecting different results
|
Wraith
Member
Reged: 08/22/07
Posts: 112
Loc: Raleigh, NC USA
|
|
select * from locks (shows all rows in the lock table)
delete from locks where lk_session_id=<whatever one is causing your problem> (deletes the "stuck" lock allowing users to edit the test again)
|
Jonty
Super Member
Reged: 01/17/07
Posts: 1267
Loc: India
|
|
sometimes you may have imposed a self lock on it..?
This happens mostly when user kill the QTP process when the script is still open(from QC).
-------------------- Cheers
Jonty..
-- Here to Learn and share ---
|
Juleo_2607
Advanced Member
Reged: 05/11/05
Posts: 442
Loc: Pune
|
|
Yes, this seems a known issue with TD/QC.
|
Nvn
Newbie
Reged: 11/19/06
Posts: 10
|
|
Hi, How to reopen it? Since we are working in a comapny they will be having a server and that server we cannot access. so how come we can run the previous SQL query and delete the particular row. Any other solution for that?
Thanks n Rgds Naveen
|
Patterson_Consulting
Active Member
Reged: 10/12/01
Posts: 719
Loc: Nashville, TN, USA
|
|
QC stores locks in the database table, so that's the only way to remove the lock. Whoever has access to Quality Center Site Administration can do this for you. Otherwise, contact your DBA.
-------------------- Boyd Patterson
Patterson Consulting, LLC
www.patterson-consulting.net
Creator of Test Design Studio - Powerful IDE for QuickTest Pro
|
Tony Davis
Veteran
Reged: 03/23/00
Posts: 3082
Loc: Orange County, CA
|
|
Probably opening a can of worms, but you can do it through workflow scripting as well (using the TDConnection database access functionality).
We created a new button and some code behind it for managers at my last place of employment to perform the needed query to delete the locked user, Although we would have to do a blanket deletion for that user, having them log out and removing all reamining locks listed in the table for the specific user (supplied via an Input box).
Still, to do this, you would need to talk to your DBA as the log in and password to the database is required to connect.
-------------------- Insanity: doing the same thing over and over again and expecting different results
|
Patterson_Consulting
Active Member
Reged: 10/12/01
Posts: 719
Loc: Nashville, TN, USA
|
|
By default, non-Admin users cannot use the 'Command' API object to execute queries on the project database unless you update the Site Admin parameters to explicitly enable this feature. I think this changed in QC 8.2, but can't remember exactly when it happened.
-------------------- Boyd Patterson
Patterson Consulting, LLC
www.patterson-consulting.net
Creator of Test Design Studio - Powerful IDE for QuickTest Pro
|
Tony Davis
Veteran
Reged: 03/23/00
Posts: 3082
Loc: Orange County, CA
|
|
hmmn - I think I might have to contact wmcvetty back there and ask exactly what we did. But thinking on it, the people who had access to it were all project admins, the only person that should have been able to handle, and know when to handle, the script being run.
I think I need to retract my statements on this as it is a little more complex than I remember it was to implement.
Thanks Boyd.
-------------------- Insanity: doing the same thing over and over again and expecting different results
|
wmcvetty
Member
Reged: 10/10/06
Posts: 133
Loc: Nashville, TN
|
|
Seems we tied a new action to a toolbar button that was limited to admin users only. Then we just used the Command API within the associated sub to create and run the query to remove the locks. That way there is no need to have to DBA's involved.
|
Tony Davis
Veteran
Reged: 03/23/00
Posts: 3082
Loc: Orange County, CA
|
|
WOW - were your ears burning? I hadn't even worked around to asking you yet! LOL
To make it easy for the original poster (yeah, I am feeling uncharacteristically generous today ), would you be able to post the function created for it against the toolbar button? Not the code to call the action, just the action itself?
Thanks Walter.
-------------------- Insanity: doing the same thing over and over again and expecting different results
|
Patterson_Consulting
Active Member
Reged: 10/12/01
Posts: 719
Loc: Nashville, TN, USA
|
|
The trick being, of course, that you can access and use the Command API object
-------------------- Boyd Patterson
Patterson Consulting, LLC
www.patterson-consulting.net
Creator of Test Design Studio - Powerful IDE for QuickTest Pro
|
wmcvetty
Member
Reged: 10/10/06
Posts: 133
Loc: Nashville, TN
|
|
Yeah, I found you talking about me in my daily searches...haha!
Code:
Sub TestPlan_DeleteLocks() On Error Resume Next desc = "Please provide the network id for the user, and please make sure" &_ "this user is logged out prior to removing locks" UName = InputBox(desc,"Provide network id") If(UName <> "") Then Set cmd = TDConnection.Command cmd.CommandText = "DELETE FROM Locks WHERE LK_USER = '" & UName & "'" cmd.Execute MsgBox "All locks for user id: " & UName & " were removed", _ vbNotify+vbOKOnly,"Compelted" Else MsgBox "No locks were changed", vbNotify+vbOKOnly, "No Info" End If On Error Goto 0 End Sub
|
Tony Davis
Veteran
Reged: 03/23/00
Posts: 3082
Loc: Orange County, CA
|
|
killjoy 
but in all seriousness, I have a question for you on that access level to make use of the command object.
Is it tied to the TDAdmin, or a project admin level? I am pretty sure that (at the time) Walter and I were the only TDAdmins, with the Group Manager and her backup set up as Project Admins at best (and I am not very confident in saying they were tied to that group access).
I think I might be on the verge of walking slowly out of the thread not to draw attention to myself as I go grab some salt to eat my words. As I should know better then to question you Boyd
-------------------- Insanity: doing the same thing over and over again and expecting different results
|
wmcvetty
Member
Reged: 10/10/06
Posts: 133
Loc: Nashville, TN
|
|
Just to be sure, I checked and the true users of this code are not in the TDAdmin group, just in the group that we had specified as project admins.
|
Tony Davis
Veteran
Reged: 03/23/00
Posts: 3082
Loc: Orange County, CA
|
|
Thanks Walter -
I'll wait for Boyd to tell me if I need to go get Salt or not at this point
-------------------- Insanity: doing the same thing over and over again and expecting different results
|
Patterson_Consulting
Active Member
Reged: 10/12/01
Posts: 719
Loc: Nashville, TN, USA
|
|
Walter, have you checked to see if your Site Admin parameters have enabled the use of the Command object?
DISABLE_COMMAND_INTERFACE = N
I'm getting curious if the QC implementation doesn't match what they documented (wouldn't be the first time).
-------------------- Boyd Patterson
Patterson Consulting, LLC
www.patterson-consulting.net
Creator of Test Design Studio - Powerful IDE for QuickTest Pro
|
wmcvetty
Member
Reged: 10/10/06
Posts: 133
Loc: Nashville, TN
|
|
Quote:
DISABLE_COMMAND_INTERFACE = N
That is what our Site Configuration is set to. So does that open the command object to everyone with that setting?
|
Patterson_Consulting
Active Member
Reged: 10/12/01
Posts: 719
Loc: Nashville, TN, USA
|
|
I feel redeemed! This setting means you're essentially turning off the security feature that was added in QC 8.2.
One of the reasons this feature was added is because the Command object doesn't restrict the type of command you can execute. As you illustrated, you're dropping records from the LOCKS table. It's just as easy to delete bugs, tests, history records, etcs. It also allows you to bypass security settings and data-hiding filters. Even someone from the Viewer user group could run any query they want.
-------------------- Boyd Patterson
Patterson Consulting, LLC
www.patterson-consulting.net
Creator of Test Design Studio - Powerful IDE for QuickTest Pro
|