It's all about the answers!

Ask a question

Is there a way to detect locked file automatically?


Rice Well (30622723) | asked Sep 14 '11, 5:09 a.m.
Hi,

Please give a suggestion about following thing about source control.

One user locked a file.
Then, in order for other users to detect that the file is locked, the users have to do either of the following things.

1, Lock another file.
2, Unload and load the repository workspace.

Or there is also this way.
Right click Stream -> Show -> Locks
then, the list of locked files shows up.


But I think it's more useful locked files are detected after refreshing the project.
Is there a way to make it possible?

6 answers



permanent link
Geoffrey Clemm (30.1k33035) | answered Sep 14 '11, 11:14 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
If you are going to use locking for certain files, or certain file
types, then the expected way of working is for someone who wants to
modify that file, or a file of that type, to always request a lock
before modifying that file. The lock will fail if someone already is
working on that file in that stream (because they will have already
locked the file).

Is there a reason you are not using that approach?

Cheers,
Geoff

On 9/14/2011 7:53 AM, rice wrote:
Hi,

Please give a suggestion about following thing about source control.

One user locked a file.
Then, in order for other users to detect that the file is locked, the
users have to do either of the following things.

1, Lock another file.
2, Unload and load the repository workspace.

Or there is also this way.
Right click Stream -> Show -> Locks
then, the list of locked files shows up.


But I think it's more useful locked files are detected after
refreshing the project.
Is there a way to make it possible?

permanent link
Rice Well (30622723) | answered Sep 15 '11, 9:17 a.m.
If you are going to use locking for certain files, or certain file
types, then the expected way of working is for someone who wants to
modify that file, or a file of that type, to always request a lock
before modifying that file. The lock will fail if someone already is
working on that file in that stream (because they will have already
locked the file).

Is there a reason you are not using that approach?

Cheers,
Geoff

On 9/14/2011 7:53 AM, rice wrote:
Hi,

Please give a suggestion about following thing about source control.

One user locked a file.
Then, in order for other users to detect that the file is locked, the
users have to do either of the following things.

1, Lock another file.
2, Unload and load the repository workspace.

Or there is also this way.
Right click Stream -> Show -> Locks
then, the list of locked files shows up.


But I think it's more useful locked files are detected after
refreshing the project.
Is there a way to make it possible?


Hi Geoff,

Thank you for your answer :)
Yes, it's one approach.

The reason why I posted this question was we expected it should work same as other source control tool such as Subversion.

If it's not possible, we will consider your suggestion :)


Thanks

permanent link
Christophe Cornu (47123) | answered Sep 15 '11, 9:29 a.m.
Hi:

Just hit "Refresh" in the Pending Changes view - this will ensure you see the latest incoming changes and the latest information about the files locked in the streams you are delivering to in the Pending Changes view.

Note if you do other operations such as check-in, accept, deliver, lock, the pending changes view will automatically refresh the corresponding workspaces and streams, thus automatically detect the new lock and incoming changes. You don't have to unload and reload to detect new locks. If so, please open a bug report, something weird would be happening that we want to figure out...

HTH
Christophe Cornu

permanent link
Rice Well (30622723) | answered Sep 15 '11, 9:44 a.m.
Hi:

Just hit "Refresh" in the Pending Changes view - this will ensure you see the latest incoming changes and the latest information about the files locked in the streams you are delivering to in the Pending Changes view.

Note if you do other operations such as check-in, accept, deliver, lock, the pending changes view will automatically refresh the corresponding workspaces and streams, thus automatically detect the new lock and incoming changes. You don't have to unload and reload to detect new locks. If so, please open a bug report, something weird would be happening that we want to figure out...

HTH
Christophe Cornu


Thank you for you answer.
Now I may understand.

In order to detect locked files, it is needed to access a stream.

With only refresh a project(eclipse project), locked files are not detected as the operation doesn't access a stream.

Am I rignt?

permanent link
Geoffrey Clemm (30.1k33035) | answered Sep 15 '11, 9:59 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
That is correct. A "refresh" on the Project/Package explorer just
rereads the file system, to see if files have changed on disk without
Eclipse having been notified. On the Pending Changes view, you have
options on the "refresh" to either look at the file system, look at the
SCM repository (where the locks are stored), or both.

Cheers,
Geoff

On 9/15/2011 9:53 AM, rice wrote:
chrisxwrote:
Hi:

Just hit "Refresh" in the Pending Changes view - this will
ensure you see the latest incoming changes and the latest information
about the files locked in the streams you are delivering to in the
Pending Changes view.

Note if you do other operations such as check-in, accept, deliver,
lock, the pending changes view will automatically refresh the
corresponding workspaces and streams, thus automatically detect the
new lock and incoming changes. You don't have to unload and reload to
detect new locks. If so, please open a bug report, something weird
would be happening that we want to figure out...

HTH
Christophe Cornu

Thank you for you answer.
Now I may understand.

In order to detect locked files, it is needed to access a stream.

With only refresh a project(eclipse project), locked files are not
detected as the operation doesn't access a stream.

Am I rignt?

permanent link
Rice Well (30622723) | answered Sep 26 '11, 9:26 a.m.
That is correct. A "refresh" on the Project/Package explorer just
rereads the file system, to see if files have changed on disk without
Eclipse having been notified. On the Pending Changes view, you have
options on the "refresh" to either look at the file system, look at the
SCM repository (where the locks are stored), or both.

Cheers,
Geoff

On 9/15/2011 9:53 AM, rice wrote:
chrisxwrote:
Hi:

Just hit "Refresh" in the Pending Changes view - this will
ensure you see the latest incoming changes and the latest information
about the files locked in the streams you are delivering to in the
Pending Changes view.

Note if you do other operations such as check-in, accept, deliver,
lock, the pending changes view will automatically refresh the
corresponding workspaces and streams, thus automatically detect the
new lock and incoming changes. You don't have to unload and reload to
detect new locks. If so, please open a bug report, something weird
would be happening that we want to figure out...

HTH
Christophe Cornu

Thank you for you answer.
Now I may understand.

In order to detect locked files, it is needed to access a stream.

With only refresh a project(eclipse project), locked files are not
detected as the operation doesn't access a stream.

Am I rignt?


Thank you very much for your advice :)

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.