I have a class variable that holds my DSL context.
myDSLContext = DSL.using(dataSource, dialect);
The data source is an instance of SQLiteDataSource and the dialect is SQLDialect.SQLITE.
It is my understanding that the default JOOQ connection provider should use the
data source to acquire and then release the connection when executing within the context.
In various methods in my class, I use myDSLContext when building and executing the SQL:
Condition condition = myRowId.between(minRowNum, maxRowNum);
Result<Record> records = myDSLContext.select(myFields).from(myDataTable).where(condition).fetch();
After the program exits, there are shm and wal temporary files left over.
These files should be automatically cleaned up if the database closes correctly: "if the last connection
does not shutdown cleanly, the WAL file will remain in the filesystem and will be
automatically cleaned up the next time the database is opened".
Since all my interaction with the DB is through the same context, what could be causing
the database (connection) to not shutdown cleanly?
By using a data source, I am able to not worry about connection management for this simple 1 user, 1 file database. In fact, it is my understanding that JOOQ uses automatic closing for me after the query is executed. This is one of the main features.
Am I missing understanding this feature?
If not, are there issues with SQLite connection management that I am missing?