Changeset 794
- Timestamp:
- Aug 10, 2010, 4:17:13 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/domain/dbnp/studycapturing/Identity.groovy
r786 r794 59 59 if (!identifier) { 60 60 // no, increment the iterator 61 identifier = iterator++ 62 63 // has the iterator become too large? 64 if (iterator >= maximumIdentity) { 65 // yes, reset it back to 0 as this iterator 66 // works for the complete application, not 67 // only the user session. We don't want it 68 // to go too high :) 69 iterator = 0 70 } 61 incrementIterator() 71 62 } 72 63 73 64 println ".instantiating [" + super.getClass() + "] ("+ identifier + ")" 65 } 66 67 // This method is synchronized to assure a thread-safe increment of the iterator variable 68 synchronized private void incrementIterator() { 69 // Increment the iterator variable 70 identifier = iterator++ 71 72 // has the iterator become too large? 73 if (iterator >= maximumIdentity) { 74 // yes, reset it back to 0 as this iterator 75 // works for the complete application, not 76 // only the user session. We don't want it 77 // to go too high :) 78 iterator = 0 79 } 80 74 81 } 75 82
Note: See TracChangeset
for help on using the changeset viewer.