B4J Question [jRDC2] with SQLite -> need help with WAL & Pool

jmon

Well-Known Member
Licensed User
Longtime User
Hello,

I am using jRDC2 with SQLite.

I have already set my SQLite db in PRAGMA journal_mode = wal:
https://www.b4x.com/android/forum/t...ent-access-to-sqlite-databases.39904/#content

but I read here:
https://www.b4x.com/android/forum/t...ate-your-own-back-end-database.31616/#content
that I should set the min & max pool size to 1:
B4X:
Dim jo As JavaObject = pool
jo.RunMethod("setMaxPoolSize", Array(1))
jo.RunMethod("setMinPoolSize", Array(1))

Is this correct? Because in my tests, that appeared to slow down the jRDC server.
If I leave the default value of the pool, it returns results faster when I do multiple queries.

Also, any other tweaks I could perform to improve the performance? For example, is there a way to cache queries?

Thanks for your help
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Is this correct?
Yes. There should only be a single connection at a time.

The performance should be still quite fast: https://www.b4x.com/android/forum/threads/server-performance-measures.37502/#post-238853

For example, is there a way to cache queries?
This is the responsibility of the SQL engine. You can extend jRDC and cache common query results. I recommend you to try first without it.

The most important optimization is to use indices correctly.
 
Upvote 0

jmon

Well-Known Member
Licensed User
Longtime User
The most important optimization is to use indices correctly.
Thank you, I will do that.

I'm doing some performance tests, and I can insert 10K rows in 900ms with jRDC2, but on a local network.
Querying a quite complex statement with multiple JOINs, I get the result in 500ms.
Querying a simple statement, I get the result in 60ms.

So that seems quite good.
 
Upvote 0
Top