It's all about the answers!

Ask a question

Jazz Source Control Pessimistic locking doesn't work?


Klaus Kirnbauer (1111) | asked Jan 12 '15, 6:08 a.m.
edited Oct 10 '17, 11:22 a.m. by David Lafreniere (4.4k7)

Hi,

i've installed version 5.0.2, because i want to use the new perssimistic locking feature.

We have one stream and serveral workspaces.

The stream should lock the following filetypes:
.rpgle, .rpg, .pf, .lf, .prtf, .dspf, .clle, .cl
 
I have done these entries in the new provided text area and saved it.

Now if i open a rpgle file from my workspace, and my colleague opens the same file from his own workspace.

Shouldn't I get now a dialog box with lock read only?

Or how does that feature work?


Accepted answer


permanent link
Alex Fitzpatrick (5583716) | answered Mar 11 '15, 12:45 p.m.
JAZZ DEVELOPER
It's important that users understand the supported workflow, and there's two basic cases:

Editing in Eclipse
Most Eclipse editor use Eclipse Team API functions to signal that an edit is beginning allowing the current SCM system to intervene, with RTC that means that as soon as the first change is detected then for these automatically locked file types the user will be prompted to lock the file.

Note this means that if no changes are made then the file is not locked by RTC and the file is left as read-only on disk. To initiate the locking procedure a change must be made.

(Note, as mentioned by Shashikant, there are non-conformant editors that may appear in Eclipse but not correctly invoke the Team API, in this case treat the file as if it was edited externally.) 

Editing with non-Eclipse Applications
Since non-Eclipse editors have no way to interact with the Team API users must manually lock the "automatically locked" files they wish to edit externally. If the user does not manually initiate the lock then the file is left as read-only through the file system. This means that users will be able to make changes in external applications but unable to save them until a lock is initiated.
David Lafreniere selected this answer as the correct answer

2 other answers



permanent link
Ralph Schoon (56.5k23642) | answered Jan 12 '15, 7:09 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Have you looked at https://jazz.net/downloads/rational-team-concert/releases/5.0.2?p=news#pessimisticLocking ?

Comments
Klaus Kirnbauer commented Jan 12 '15, 7:56 a.m. | edited Jan 12 '15, 8:17 a.m.

Hello Ralph,

thanks for your answer.

yes i checked that link before.

I am on RDi version 9.0.1 and added the file patterns like above.

I am using the iProjects perspective for editing and compiling my files.

When I edit a file for the first time in the Eclipse client, I should get prompted to acquire the lock on that file, but there is no dialog ???

The preferences for auto-locking can you see here. Pref autolock


Shashikant Padur commented Jan 12 '15, 11:34 p.m. | edited Mar 12 '15, 2:02 a.m.
JAZZ DEVELOPER

Couple of questions:

1) Did you load the workspace after setting the pattern?
2) Did those files load as read-only files? Check the file system attributes.

Usually when you edit the file in Eclipse it sends an edit/modified event. I am not sure if this happens by default for any kind of app or the app has to do some special processing.

3) Can you edit and save the file? I believe the save should trigger the read-only/save event and if so it should bring up that dialog.


Klaus Kirnbauer commented Jan 13 '15, 1:12 a.m. | edited Mar 12 '15, 2:02 a.m.

Hi,

1) yes i loaded the workspace several times after setting the pattern.
2) No, the files can be edited and saved.

Do you know the settings for special processing?

3) yes i can save and edit the file, but it doesn't bring up the dialog.


permanent link
Shashikant Padur (4.0k27) | answered Jan 13 '15, 1:51 a.m.
JAZZ DEVELOPER
>>> No, the files can be edited and saved.
This suggests that the pattern did not get applied/processed during the load. Is the stream the default flow target? The current design only works when the stream is the default flow target.

Another thing to try out is to change the file attributes to read only manually and then try editing or saving the file. This should show the dialog. This is not a solution but to confirm that the dialog shows up.

Comments
Klaus Kirnbauer commented Jan 13 '15, 2:10 a.m. | edited Mar 12 '15, 2:03 a.m.


>>This suggests that the pattern did not get applied/processed during the load. Is the stream the default flow target?

Yes it is the default target.

>> Another thing to try out is to change the file attributes to read only manually and then try editing or saving the file. This should show the dialog. This is not a solution but to confirm that the dialog shows up.

Now i found a scenario, when the dialog shows up.

When i opened a RPGLE file, then set the file attribute manually to read only and then edit and save the file, the dialog shows up.

When i set this file to read only before opening it, i am in browse mode and can't change anything.


Do you know that problem?


Shashikant Padur commented Jan 13 '15, 4:41 a.m. | edited Mar 12 '15, 2:04 a.m.
JAZZ DEVELOPER

I am not sure what do you mean by browse mode. Did you mean you cannot open it inside of Eclipse?


I am not sure why .rpgle file is not set to read-only. What about other extensions such as .rpg, .pf, .lf, .prtf, .dspf, .clle, *.cl? Are any of those files loaded as read-only? By the way, I am assuming you are not reloading but loading into a new sandbox on every load.


Klaus Kirnbauer commented Jan 13 '15, 5:06 a.m. | edited Mar 12 '15, 2:04 a.m.

I can't edit anything, when i set the file manualy to read only before open it.

It makes no difference with other extensions .rpg, .pf, .lf, .prtf, .dspf, .clle, .cl, .jsp





Shashikant Padur commented Jan 13 '15, 5:18 a.m.
JAZZ DEVELOPER

I am wondering when RDi is opening the file and if it is a read-only file it disables editing and puts it in browse mode. If the app controls that then this feature cannot work.

By the way, not setting the file to read-only during load is a defect. Please raise a defect.


Klaus Kirnbauer commented Jan 14 '15, 3:07 a.m.

i've tested it now with the RTC eclipse client. The files are now automatically read-only if the pattern matched, but i cannot edit the files because it is also in only in browse mode.


Klaus Kirnbauer commented Jan 15 '15, 4:29 a.m. | edited Mar 12 '15, 2:04 a.m.

I've done a screencast to show the problem:
https://www.screenr.com/AAuN


Shashikant Padur commented Jan 16 '15, 12:32 a.m.
JAZZ DEVELOPER

Thanks. As mentioned earlier since the RDi editor is a custom editor it may not be calling the expected FileModificationValidator extension. Not sure if there is a workaround as I am not familiar with RDi.

showing 5 of 7 show 2 more comments

Your answer


Register or to post your answer.