Releasing connections #55
-
We have developed a Cordova plugin for our mobile application and we are using the iOS library, we're also using the Android library, but the issue we found was on iOS. While investigation a performance issue, we found that GPKGConnection.queryWithDistinct gets a resultConnection, but doesn't release it. This resulted in the usedConnections continuously growing. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
Hello. Yes, a GPKGResultSet returned from any method should/must be closed immediately when the results are no longer needed. A SQLite (read result) connection is pulled from the connection pool for the query and not released until the GPKGResultSet is closed. At the same time, that connection must remain open temporarily to access those results. Any method in this library that internally opens but does not return the result set, closes that connection before return (unless you found a bug where that is not the case). Any call to this library that is returned any type of Result Set becomes responsible for closing the results as part of normal and expected usage. Unless I am misunderstanding this doesn't appear to be an issue within the library and upon closing all your query results there was no issue? Edit: FYI on Android, any type of Cursor or CursorResults should also be closed to avoid issues. |
Beta Was this translation helpful? Give feedback.
Hello.
Yes, a GPKGResultSet returned from any method should/must be closed immediately when the results are no longer needed. A SQLite (read result) connection is pulled from the connection pool for the query and not released until the GPKGResultSet is closed. At the same time, that connection must remain open temporarily to access those results. Any method in this library that internally opens but does not return the result set, closes that connection before return (unless you found a bug where that is not the case). Any call to this library that is returned any type of Result Set becomes responsible for closing the results as part of normal and expected usage.
Unless I am misunderstandi…