Advise on a idea

Post

Posted
Rating:
#1 (In Topic #708)
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
 Hi Everyone,

I was hoping I could get some advise on a idea that I am thinking about

This is what I have at the moment a small
Application written in Gambas that connects to a central MySQL server and pulls down all data from that server to a local MySQL server (this may change if I can find a low memory database that works with Gambas)

The sync app starts full screen but once it has done the first sync (get all data etc) from the server is there a way to switch it to a screenless app in the background?

I know if I start the app like

./home/algpos/dbsyc/dbsync.gambas && the app will run in the background but I need it to be in the only app that has focus until it has completed its work.

Is it possible to switch apps between main and background work?
Online now: No Back to the top

Post

Posted
Rating:
#2
Guru
BruceSteers is in the usergroup ‘Guru’
 it may not retain focus but you can set Form.TopOnly = True or False and Form.Stacking = Window.Above or Window.Normal
that will keep your window above all the others and you can unset the flags when it's done
Online now: No Back to the top

Post

Posted
Rating:
#3
Guru
BruceSteers is in the usergroup ‘Guru’
if you want your app to talk to other gambas apps of yours then look into DBus
Online now: No Back to the top

Post

Posted
Rating:
#4
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
 I'm using pipe to talk between the apps
Online now: No Back to the top

Post

Posted
Rating:
#5
Guru
BruceSteers is in the usergroup ‘Guru’

AndyGable said

I'm using pipe to talk between the apps

cool then your main app could disable the other apps while it's working then release them when it's done it's business
Online now: No Back to the top

Post

Posted
Rating:
#6
Avatar
Enthusiast
PJBlack is in the usergroup ‘Enthusiast’
i honestly don't understand the intention behind your question …

is it about computation time? then have a look at the command nice (i have seen functional somewhere in gambas too)

and an application that compares the data … uh yes … if you have two mysql servers running anyway (i hope you mean mariadb) have a look at the terms replication, and/or cluster and let the one who can do it best do the work …
if you need something small on the client side you could also use sqlite and mariadb/mysql on the server … also with this the replication works


<COLOR color="#000080">Translated with www.DeepL.com/Translator</COLOR>
Online now: No Back to the top

Post

Posted
Rating:
#7
Guru
BruceSteers is in the usergroup ‘Guru’
I think i may have misread the question, you kinda lost me a bit at SQL..

How about something like…

Code (gambas)

  1. FMain.FullScreen = True
  2.  
  3. ' do your routines..
  4.  
  5. ' when finished
  6.  
  7. FMain.FullScreen = False
  8.  
  9.  
Online now: No Back to the top

Post

Posted
Rating:
#8
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’

BruceSteers said

I think i may have misread the question, you kinda lost me a bit at SQL..

How about something like…

Code (gambas)

  1. FMain.FullScreen = True
  2.  
  3. ' do your routines..
  4.  
  5. ' when finished
  6.  
  7. FMain.FullScreen = False
  8.  
  9.  

That does not put the application into the background that only makes the app screenless.
Online now: No Back to the top

Post

Posted
Rating:
#9
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’

PJBlack said

i honestly don't understand the intention behind your question …

is it about computation time? then have a look at the command nice (i have seen functional somewhere in gambas too)

and an application that compares the data … uh yes … if you have two mysql servers running anyway (i hope you mean mariadb) have a look at the terms replication, and/or cluster and let the one who can do it best do the work …
if you need something small on the client side you could also use sqlite and mariadb/mysql on the server … also with this the replication works


<COLOR color="#000080">Translated with www.DeepL.com/Translator</COLOR>

PJBlack
Yes Replication would be a way to do this but it would replicate EVERY things from the Master Database to the Local PoS Database and I do not need every table and every field on the local PoS Database.

I have created the sync app so I can control what information is sent to the master database (mysql) and what is deleted from the local Database.

Does anyone have any examples of how to use sqlite with Gambas?
Online now: No Back to the top

Post

Posted
Rating:
#10
Avatar
Enthusiast
PJBlack is in the usergroup ‘Enthusiast’

AndyGable said

Does anyone have any examples of how to use sqlite with Gambas?

https://gambaswiki.org/wiki/howto/databasesqlite
https://gambaswiki.org/wiki/comp/gb.db/connection
https://www.sqlite.org

the difference between sqlite and real dbms is a) the lack of user management, b) sqlite is local and file based and c) the usual small things …

if you have a connection open sqlite will be accessed via sql just like other databases …


AndyGable said

That does not put the application into the background that only makes the app screenless.

https://gambaswiki.org…p/gb/application/priority
https://gambaswiki.org…omp/gb/application/daemon
Online now: No Back to the top

Post

Posted
Rating:
#11
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
  PJBlack

Thanks for the links I shall have a read.

Will I be able to have 2 local apps (the sync program and the actual till program) read and write to the SQLite database at the same time? Or will I get the same database locked error message that I did on windows (that was why I used firebird for the local database
Online now: No Back to the top

Post

Posted
Rating:
#12
Avatar
Enthusiast
PJBlack is in the usergroup ‘Enthusiast’
opening a connection at the same time should not be a problem … reading at the same time should not be a problem but writing at the same time could be a problem … see

https://en.wikipedia.org/wiki/Deadlock

and

https://www.sqlite.org/lockingv3.html
https://www.sqlite.org/wal.html

however, since i know neither the requirements of your program nor your concept for realization, it is difficult to make binding statements …
Online now: No Back to the top
1 guest and 0 members have just viewed this.