Bug #1197 (closed)
Opened 15 years ago
Closed 15 years ago
ShareI does not have membersCounter
Reported by: | atarkowska | Owned by: | jamoore |
---|---|---|---|
Priority: | critical | Cc: | |
Sprint: | n.a. | ||
Total Remaining Time: | n.a. |
Description (last modified by atarkowska)
Could be possible to have a number of members in ShareI.
Change History (8)
comment:1 Changed 15 years ago by atarkowska
- Description modified (diff)
- Milestone changed from Unscheduled to OMERO-Beta4
comment:2 Changed 15 years ago by jmoore
comment:3 Changed 15 years ago by atarkowska
I mean field
comment:4 Changed 15 years ago by jmoore
Ola, would a SessionExperimenterMap solve this problem for you? This may be the cleanest way to model the interaction. It would also solve a performance problem in getMemberShares()
comment:5 Changed 15 years ago by jmoore
- Priority changed from major to critical
comment:6 Changed 15 years ago by atarkowska
sounds good to me, thx
comment:7 Changed 15 years ago by jmoore
r3915 contains a new table ShareMember. It is not yet used, but my hope is that we can prevent users who want to play with RC1 from having to re-create their databases.
comment:8 Changed 15 years ago by jmoore
- Resolution set to fixed
- Status changed from new to closed
The original request was for a member count on shares. Since there was also a performance issue (linear scan over the binary data in the shares) for ShareStore.getShares(long, boolean, boolean), it made sense to add a link between shares and experimenters.
In r3915, the ShareMember type was added to do the linking of shares and members
outside of the ShareData object and in a table. (The fact that this
does not count guests will need to be handled in another way if desired)
However, I didn't add Share.memberLinks (the bidirectional relationship) in order to keep changes minimal in case this is not the proper solution. For the moment, this means that counts won't come with the shares, but must be retrieved in a separate call:
Map<Long, Long> getMemberCount(Set<Long> shareIds);
A similar method was added for comment counts.
Both of these methods return the proper value for admins, owners, and share members, and throw a ValidationException otherwise.
Ola, do you just mean a method to return that, or as a field on Share?