Commit 14839ba
Skip synchronized block in close() if ResultSet is already closed (xerial#358)
Fixes xerial#349
From profiling our app in production we noticed that our finalizer thread was periodically getting the synchronized lock on the DB (introduced in xerial#215). By the time our ResultSet hits the finalizer queue the ResultSet has already been closed, so there's no need to acquire the lock to reset the statement pointer. As part of this I've removed what I believe to be dead code around checking for the nullability of the stmt member on the ResultSet.1 parent ed45927 commit 14839baCopy full SHA for 14839ba
2 files changed
+21-6Lines changed: 21 additions & 6 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- src
- main/java/org/sqlite/core
- test/java/org/sqlite
Expand file treeCollapse file tree
Open diff view settings
Collapse file
src/main/java/org/sqlite/core/CoreResultSet.java
Copy file name to clipboardExpand all lines: src/main/java/org/sqlite/core/CoreResultSet.java+7-6Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
120 | 120 | |
121 | 121 | |
122 | 122 | |
123 | | - |
124 | 123 | |
125 | 124 | |
126 | 125 | |
127 | 126 | |
128 | 127 | |
| 128 | + |
| 129 | + |
| 130 | + |
| 131 | + |
129 | 132 | |
130 | 133 | |
131 | | - |
132 | | - |
133 | | - |
134 | | - |
135 | | - |
| 134 | + |
136 | 135 | |
137 | 136 | |
138 | 137 | |
| ||
141 | 140 | |
142 | 141 | |
143 | 142 | |
| 143 | + |
| 144 | + |
144 | 145 | |
145 | 146 | |
146 | 147 | |
|
Collapse file
src/test/java/org/sqlite/ResultSetTest.java
Copy file name to clipboardExpand all lines: src/test/java/org/sqlite/ResultSetTest.java+14Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
140 | 140 | |
141 | 141 | |
142 | 142 | |
| 143 | + |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | + |
| 148 | + |
| 149 | + |
| 150 | + |
| 151 | + |
| 152 | + |
| 153 | + |
| 154 | + |
| 155 | + |
| 156 | + |
143 | 157 | |
0 commit comments