B4J Question Sqlite Database question / advice

Num3

Active Member
Licensed User
Longtime User
Hi all,

I have a question for you guys, what is the best practice for using a local sqlite database on a permanent server (running 24/7):

1. Open the connection once (when server starts) and reuse it forever while the server is running.
2. Open and close the connection every time a query to the database is made.

Both have pros and cons, i ask for advice based on personal experience.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
Using the WAL mode is a good choice. SQLite works fine if you don't have millions of updates in a short time (works but slows down). Just give it a try. Switching to MySQL is quite easy. It (of course) all depends on the amount of db traffic.
 
Upvote 0
Top