Open calippo opened 8 years ago
I thought I solved just using:
configCP.addDataSourceProperty("dataSource.journal_mode", "WAL")
It doesn't return an error, but the database is still in delete
mode
@calippo The datasource property should have helped.
Try the below to see if that works.
val dbUrl = "jdbc:sqlite:db.sqlite?journal_mode=WAL"
@mmuruganandam It creates a database called db.sqlite?journal_mode=WAL
I solved my problem using slick typesafe (scala) configuration and loading journal_mode = "wal"
property from configuration. Still I don't understand why the other way is not working.
@calippo If journal_mode = "wal"
worked, but configCP.addDataSourceProperty("journal_mode", "WAL")
did not, it is probably a simple issue of "WAL"
needing to be lower-case ("wal"
).
It looks like it's case insensitive.
@brettwooldridge with lowecase wal
and property journal_mode
I get Connection attempt to database HikariPool-0 failed: batch entry 0: query returns results
error.
With lower case wal
and property dataSource.journal_mode
the database is still in delete
mode.
@calippo Ok, I'll have to investigate further. As far as I know, Slick is simply calling addDataSourceProperty()
, just as you have, so it is hard to imagine what the difference could be.
@brettwooldridge in case you need it https://github.com/calippo/hikari-sqlite-wal
Any further investigation on this?
Moved to MySQL :)
To switch sqlite database to WAL mode forever, you should issue PRAGMA journal_mode= WAL;
SQL command once, that's it. No need to tweak connection parameters.
Hi! I'm trying to use my sqlite database in WAL mode. It should be doable just by passing a property to DriverManager as in:
My code looks like:
I am getting this error:
Connection attempt to database HikariPool-0 failed: batch entry 0: query returns results
(as if setConnectionTestQuery was not there). Is this supported by Hikari?