Revision 6717
Added by Chris Jones almost 13 years ago
src/edu/ucsb/nceas/metacat/dataone/CNodeService.java | ||
---|---|---|
125 | 125 |
throws NotImplemented, NotFound, NotAuthorized, ServiceFailure, |
126 | 126 |
InvalidRequest, InvalidToken { |
127 | 127 |
|
128 |
// The lock to be used for thyis identifier
|
|
128 |
// The lock to be used for this identifier |
|
129 | 129 |
ILock lock = null; |
130 | 130 |
|
131 | 131 |
// get the subject |
... | ... | |
139 | 139 |
|
140 | 140 |
SystemMetadata systemMetadata = null; |
141 | 141 |
try { |
142 |
lock = HazelcastService.getInstance().getLock(pid.getValue()); |
|
143 |
lock.lock(); |
|
144 |
systemMetadata = HazelcastService.getInstance().getSystemMetadataMap().get(pid); |
|
142 |
if ( HazelcastService.getInstance().getSystemMetadataMap().containsKey(pid) ) { |
|
143 |
lock = HazelcastService.getInstance().getLock(pid.getValue()); |
|
144 |
lock.lock(); |
|
145 |
systemMetadata = HazelcastService.getInstance().getSystemMetadataMap().get(pid); |
|
146 |
|
|
147 |
} |
|
145 | 148 |
|
146 | 149 |
|
147 | 150 |
// does the request have the most current system metadata? |
... | ... | |
172 | 175 |
|
173 | 176 |
} finally { |
174 | 177 |
lock.unlock(); |
178 |
logMetacat.debug("Unlocked identifier " + pid.getValue()); |
|
179 |
|
|
175 | 180 |
|
176 | 181 |
} |
177 | 182 |
|
... | ... | |
322 | 327 |
|
323 | 328 |
} finally { |
324 | 329 |
lock.unlock(); |
325 |
|
|
330 |
logMetacat.debug("Unlocked identifier " + pid.getValue()); |
|
331 |
|
|
326 | 332 |
} |
327 | 333 |
|
328 | 334 |
return true; |
... | ... | |
404 | 410 |
|
405 | 411 |
} finally { |
406 | 412 |
lock.unlock(); |
413 |
logMetacat.debug("Unlocked identifier " + pidOfSubject.getValue()); |
|
407 | 414 |
|
408 | 415 |
} |
409 | 416 |
|
... | ... | |
451 | 458 |
|
452 | 459 |
} finally { |
453 | 460 |
lock.unlock(); |
461 |
logMetacat.debug("Unlocked identifier " + pid.getValue()); |
|
454 | 462 |
|
455 | 463 |
} |
456 | 464 |
|
... | ... | |
693 | 701 |
|
694 | 702 |
} finally { |
695 | 703 |
lock.unlock(); |
704 |
logMetacat.debug("Unlocked identifier " + pid.getValue()); |
|
696 | 705 |
|
697 | 706 |
} |
698 | 707 |
|
... | ... | |
837 | 846 |
|
838 | 847 |
} finally { |
839 | 848 |
lock.unlock(); |
849 |
logMetacat.debug("Unlocked identifier " + pid.getValue()); |
|
850 |
|
|
840 | 851 |
} |
841 | 852 |
|
842 | 853 |
return pid; |
... | ... | |
946 | 957 |
} finally { |
947 | 958 |
// always unlock the pid |
948 | 959 |
lock.unlock(); |
960 |
logMetacat.debug("Unlocked identifier " + pid.getValue()); |
|
949 | 961 |
|
950 | 962 |
} |
951 | 963 |
|
... | ... | |
1026 | 1038 |
|
1027 | 1039 |
} finally { |
1028 | 1040 |
lock.unlock(); |
1029 |
|
|
1041 |
logMetacat.debug("Unlocked identifier " + pid.getValue()); |
|
1042 |
|
|
1030 | 1043 |
} |
1031 | 1044 |
|
1032 | 1045 |
return pid; |
... | ... | |
1104 | 1117 |
|
1105 | 1118 |
} finally { |
1106 | 1119 |
lock.unlock(); |
1120 |
logMetacat.debug("Unlocked identifier " + pid.getValue()); |
|
1107 | 1121 |
|
1108 | 1122 |
} |
1109 | 1123 |
|
... | ... | |
1203 | 1217 |
|
1204 | 1218 |
} finally { |
1205 | 1219 |
lock.unlock(); |
1220 |
logMetacat.debug("Unlocked identifier " + pid.getValue()); |
|
1206 | 1221 |
|
1207 | 1222 |
} |
1208 | 1223 |
|
Also available in: Unified diff
Add log statements for each call to ILock.unlock() for debugging.