In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

SQLite number of active connections

Xailer professional forum in English
Responder
Avatar de Usuario
emeasoft
Mensajes: 1088
Registrado: Mié Abr 01, 2009 4:12 pm
Ubicación: emeasoft
Contactar:

SQLite number of active connections

Mensaje por emeasoft »

Hello Xailers,

Is there any way to know how many active connections the database have?

TIA,
Juliano
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5706
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Re: SQLite number of active connections

Mensaje por jfgimenez »

Juliano,

I don't know any way to get it.

However, if you think that your app is going to be used by several users at once, I suggest you to jump to MariaDB. SQLite and MariaDB (or MySQL) are very close in terms of SQL dialect, and it's very easy to replace one by the other. Moreover, it's really easy to support both DB engines in any app. Almost all my programs support both engines, and I select one of them just when I install it in the customer computer.
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Avatar de Usuario
emeasoft
Mensajes: 1088
Registrado: Mié Abr 01, 2009 4:12 pm
Ubicación: emeasoft
Contactar:

Re: SQLite number of active connections

Mensaje por emeasoft »

Thanks José!

But I was needing this exactly to allow just one connection to the database at a time... We will try to figure some way to do it then, thanks!

Regards,
Juliano
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9246
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: SQLite number of active connections

Mensaje por ignacio »

Try with oDS:Execute( "PRAGMA main.locking_mode=EXCLUSIVE;" )

Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5706
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Re: SQLite number of active connections

Mensaje por jfgimenez »

Juliano,

the solution proposed by Ignacio is explained here: https://www.sqlite.org/pragma.html#pragma_locking_mode
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Responder