mirror of
https://github.com/librecaptcha/lc-core.git
synced 2025-01-12 22:43:20 -05:00
minor: added comment about per thread connections
This commit is contained in:
parent
79428bc5e7
commit
f8de5a5932
@ -110,6 +110,13 @@ class Statements(dbConn: DBConn, maxAttempts: Int) {
|
||||
}
|
||||
|
||||
object Statements {
|
||||
/* Note: h2 documentation recommends using a separate DB connection per thread
|
||||
But in practice, as of version 1.4.200, multiple connections occassionally shows error on the console of the form
|
||||
```
|
||||
org.h2.jdbc.JdbcSQLNonTransientException: General error: "java.lang.NullPointerException"; SQL statement:
|
||||
SELECT image FROM challenge c, mapId m WHERE c.token=m.token AND m.uuid = ? [50000-200]
|
||||
```
|
||||
*/
|
||||
private val dbConn: DBConn = new DBConn()
|
||||
private val maxAttempts = 10
|
||||
val tlStmts: ThreadLocal[Statements] = ThreadLocal.withInitial(() => new Statements(dbConn, maxAttempts))
|
||||
|
Loading…
Reference in New Issue
Block a user