Topic: Multiuser

Hello,

I've placed the application on the server and we want to work 3-4 users in the app.
As soon as the second user is connected to the application, the app is getting very slow, the data and the forms are loading very slowly.
What shall I do to make it work? In this moment the database has approx. 250 Mb and is growing.

I want to mention that, production needs only to book some data in their special form, planning to put orders in the app and print the papers in his special form.
Thank you for a solution.

Br,
Alin

Best regards,
Alin

Re: Multiuser

Are you using SQLite or MySQL?

On a clear disk you can seek forever

Re: Multiuser

CDB wrote:

Are you using SQLite or MySQL?

I'm using SQLite.

Best regards,
Alin

4 (edited by CDB 2021-03-04 18:55:46)

Re: Multiuser

You could try putting SQLite into 'WAL' mode, this might help.


Just a warning, if you intend to have the SQlite database file on a network share drive and an IT department runs a cache clearing program in the background, you will lose data and get locked database messages.


If there is no cache clearing program is running, then there shouldn't be any problems.

To enable WAL mode in sqlite, open your database in a database browser such as DB Browser for SQL Lite and type in under the SQL tab

PRAGMA journal_mode = WAL

Close the browser and when you next open your program you will see 3 extra files appear, these are the caching files.

If this doesn't work for you, then to disable Write Ahead Logging open the DB browser and type into the SQL tab


PRAGMA journal_mode=DELETE
On a clear disk you can seek forever

Re: Multiuser

CDB, Thank you for your reply.
Tried both solution, but my app is still very slow.
Should I try something else?

Thanks.

Alin

Best regards,
Alin

Re: Multiuser

m.alin,,
Try placing the app on the client workstations, but keep the database on the server.

Re: Multiuser

ehwagner wrote:

m.alin,,
Try placing the app on the client workstations, but keep the database on the server.

Can you tell us more how to do that? If i move the app to the client workstations how do they link to the database on the server?

Thanks in advance.

8 (edited by CDB 2021-03-08 19:25:20)

Re: Multiuser

vanadu55,


You need to copy the following files to a folder on each client workstation in addition to your EXE file (Don't put them on the desktop).

1. Script folder containing just the dcu file.
2. Forms.xml .
3  sqlite3.dll .
4. Settings.ini
5. Any graphics.dll  if it exists +  image files if they exist.


Now you can either manually change the server path  to the database in the settings.ini file or install on one PC, run the program and then follow the dialogue prompts when your program can't find the database.  Once you have one settings.ini file set up, you can just copy that one to each PC.


Once that is done then you can place a shortcut on the desktops if you so wish.

On a clear disk you can seek forever

Re: Multiuser

CDB wrote:

vanadu55,


You need to copy the following files to a folder on each client workstation in addition to your EXE file (Don't put them on the desktop).

1. Script folder containing just the dcu file.
2. Forms.xml .
3  sqlite3.dll .
4. Settings.ini
5. Any graphics.dll  if it exists +  image files if they exist.


Now you can either manually change the server path  to the database in the settings.ini file or install on one PC, run the program and then follow the dialogue prompts when your program can't find the database.  Once you have one settings.ini file set up, you can just copy that one to each PC.


Once that is done then you can place a shortcut on the desktops if you so wish.

Thanks for the explanation!

Re: Multiuser

A stupid question. What do you mean WAL???
And a second question. When i share all the files to my users and just place the database file (sqlite.db) with a usb stick in my router csan  the users connect to the database?  And if yes how to do that or  if there is another easy way. I am not an expert so it better to explain step by step. Thank you.

11

Re: Multiuser

v_pozidis wrote:

A stupid question. What do you mean WAL???

I can answer your first question easily.  WAL stands for Write Ahead Logging, which allows SQLite to have multiusers access it.

However, these are special cache files that it writes, and won't automatically commit users data changes to the database. It basically will wait until the last user has closed their connection with the DB (with MVD that is just closing the application) and then it updates the database. I believe it commits data to the database as the cache reaches a certain point.


As for your other question, I'll have to think about it and maybe someone else can answer off the top of their head.

On a clear disk you can seek forever

Re: Multiuser

CDB wrote:
v_pozidis wrote:

A stupid question. What do you mean WAL???

I can answer your first question easily.  WAL stands for Write Ahead Logging, which allows SQLite to have multiusers access it.

However, these are special cache files that it writes, and won't automatically commit users data changes to the database. It basically will wait until the last user has closed their connection with the DB (with MVD that is just closing the application) and then it updates the database. I believe it commits data to the database as the cache reaches a certain point.


As for your other question, I'll have to think about it and maybe someone else can answer off the top of their head.


Thank's for your quick response. So this is not a real time connection to the database. it is not useful for my case. I t will be great if someone could answer the second question.

Re: Multiuser

To answer your second question, you need to place your database on a shareable resource such as a separate server machine which serves all the client workstations. The database needs to be mapped to a drive letter. If your USB stick in the router can be mapped to a drive letter, then you can define the location in the client settings.ini file. But I seriously doubt you can do that. I've not heard of that capability. But if you can see the USB stick in your Windows explorer then you should be able to access it. Plus it needs to be shareable to all your users.