You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking through the current implementation the DBAdapter createCursor function is never called by the service implementation which makes it feel like it is a private function that has leaked into the public interface.
Alternatively if this was created to allow for extended access to do more complicated queries/actions I can understand it being public. But then I feel it should have some kind of standardized return type. At minimum it should require close function to be part of the returned value so that actual cursor implementations are not left open. Those who don't return open connections can implement an empty close function. From what I have seen close is a pretty standard method for telling the object to no longer hold the connection/memory open.
Mongo package is one of those scenarios and the returned cursor appears to never gets close called on it once the values are retrieved from the MongoCursor object.
If the function is not meant to return a still open connection and the close is suppose to be done inside the cursor function can I suggest a name change? Cursors are normally understood to be a link to unretrieved data meaning the connection has remained open.
I only noticed this as I build my own adapter and I am having trouble understanding the uses for a lot of the "lower" functions as they seem to not be required by the DBService but still are publicly required to be on the DBAdapter implementation.
The text was updated successfully, but these errors were encountered:
Looking through the current implementation the DBAdapter createCursor function is never called by the service implementation which makes it feel like it is a private function that has leaked into the public interface.
Alternatively if this was created to allow for extended access to do more complicated queries/actions I can understand it being public. But then I feel it should have some kind of standardized return type. At minimum it should require
close
function to be part of the returned value so that actual cursor implementations are not left open. Those who don't return open connections can implement an empty close function. From what I have seenclose
is a pretty standard method for telling the object to no longer hold the connection/memory open.Mongo package is one of those scenarios and the returned cursor appears to never gets close called on it once the values are retrieved from the
MongoCursor
object.If the function is not meant to return a still open connection and the close is suppose to be done inside the cursor function can I suggest a name change? Cursors are normally understood to be a link to unretrieved data meaning the connection has remained open.
I only noticed this as I build my own adapter and I am having trouble understanding the uses for a lot of the "lower" functions as they seem to not be required by the DBService but still are publicly required to be on the DBAdapter implementation.
The text was updated successfully, but these errors were encountered: