FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour SqLite in network
Posts: 437
Joined: Fri Oct 07, 2005 12:56 PM
SqLite in network
Posted: Thu Oct 20, 2011 12:44 PM

Hi,
I begin project with FireBird , but I like SqLite . I found SqLitenning ( http://www.sqlitening.com/support/index.php ) as solution to work in network , but couldn't to force to work that . Maybe any of us have experience with SqLite in network enviroment ? I know that official opinnion is that SqLite can't work in network , but ... I hope that exist solution for that ... :-) .

With best regards !

Rimantas U.
Posts: 103
Joined: Sat Oct 18, 2008 08:13 PM
Re: SqLite in network
Posted: Thu Oct 20, 2011 01:04 PM
Maybe using Harbour netio will be a solution. Using at server NETIO server app with access to SQLite and on the workstations a NETIO client app.
Best Regards,

Ruediger Alich



---

HMG 3.1.3 | FTDN/FWH 13.12 | Harbour 3.2 | BCC/MinGW | Windows XP/Vista/7/8/10 (32/64-Bit), Wine (Linux/Mac) - started 1999 with FW, 1989 with Clipper
Posts: 437
Joined: Fri Oct 07, 2005 12:56 PM
Re: SqLite in network
Posted: Thu Oct 20, 2011 03:34 PM
IBTC wrote:Maybe using Harbour netio will be a solution. Using at server NETIO server app with access to SQLite and on the workstations a NETIO client app.


Very , very interesting ... :-) :-) . It worst to try , I think . Many thanks to you !
Rimantas U.
Posts: 437
Joined: Fri Oct 07, 2005 12:56 PM
Re: SqLite in network
Posted: Thu Oct 20, 2011 04:23 PM
IBTC wrote:Maybe using Harbour netio will be a solution. Using at server NETIO server app with access to SQLite and on the workstations a NETIO client app.


In sources of harbour I found , that hbnetio can work as Windows service , but can't to find info how to run in this mode . Can you help to me ?

With best regards !
Rimantas U.
Posts: 103
Joined: Sat Oct 18, 2008 08:13 PM
Re: SqLite in network
Posted: Thu Oct 20, 2011 04:57 PM
Rimantas wrote:Can you help to me ?


Sorry, I don't know how hbnetio can work as Windows service. :-) At the moment I don't use hbnetio yet. Maybe ask at Harbour user's mailing list.
Best Regards,

Ruediger Alich



---

HMG 3.1.3 | FTDN/FWH 13.12 | Harbour 3.2 | BCC/MinGW | Windows XP/Vista/7/8/10 (32/64-Bit), Wine (Linux/Mac) - started 1999 with FW, 1989 with Clipper
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: SqLite in network
Posted: Thu Oct 20, 2011 05:30 PM

I have not looked at SQLite in years, but the last I knew, it uses file locking to update a record (instead of record locking). It was really designed for a single user. But, perhaps this has changed.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 437
Joined: Fri Oct 07, 2005 12:56 PM
Re: SqLite in network
Posted: Thu Oct 20, 2011 06:01 PM
James Bott wrote:I have not looked at SQLite in years, but the last I knew, it uses file locking to update a record (instead of record locking). It was really designed for a single user. But, perhaps this has changed.


James , nothing changed . It's all the same . Exist some technics which allows to work with SqLite in network , here they are : http://www.sqlite.org/cvstrac/wiki?p=SqliteNetwork . But ... it's very fine to work with SqLite with own tools - (x) Harbour + FwH . And Netio it seems can do the same as technologies in mentioned link . The NetIo idea is that all PC in network are working with SqLite database , but through Netio server . It can solve the problem of file locking for new records or update . I'll try that .

Regards !
Rimantas U.
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: SqLite in network
Posted: Thu Oct 20, 2011 06:45 PM

Rimantas,

I don't understand how that works, but I will be interested to hear about your progress.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
Re: SqLite in network
Posted: Fri Oct 28, 2011 02:32 PM

Hello Rimantes,
I'm using Sqlite and xHarbour since late 2010 in all my products and in network environments without problems.
Generally speaking, you don't need a client-server structure to operate on a network with Sqlite but you should cumulate the write calls inside a Begin Immediate->Commit sequence in order to minimize the file locktime.

To be clear, if you make

INSERT INTO TABLE 1 ....
INSERT INTO TABLE 2 ...
INSERT INTO TABLE 3 ...

you will have 3 lock-unlock loops

Instead, if you make

Begin immediata
INSERT INTO TABLE 1 ....
INSERT INTO TABLE 2 ...
INSERT INTO TABLE 3 ...
Commit

You have just a 1 lock-unlock loop

We have customers with also 25-28 client that operate without problem this way.
Are you using Sqlite3 with odbc or with a wrapper ?

Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: SqLite in network
Posted: Fri Oct 28, 2011 02:40 PM

Marco,

28 users on a network--that is good news. Thanks for the info.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
Re: SqLite in network
Posted: Fri Oct 28, 2011 03:12 PM

Yes, and this is not all !! Using the "WAL" mode Sqlite3 also support concurrent write calls in multitasking on the same server.

To make a sample, I have a franchising company as customer with 7-8 associated companies in different locations.
They installed my app on a remote dedicated server and any company has 2-3 client connected via remote desktop to the remote server.
I have found Sqlite3 really a good dbf replacement: just a single db file, SQL92 syntax and ACID features.

Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: SqLite in network
Posted: Fri Oct 28, 2011 04:02 PM

Marco,

I looked at SQLite a number of years ago--maybe 5. If I remember correctly I had to get a third party C program to work with FWH and interface with SQLite. Is that still how it is done? Or is there a DLL or ActiveX module or something?

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
Re: SqLite in network
Posted: Fri Oct 28, 2011 04:11 PM

James,
there is an official wrapper for harbour but for xharbour - as I know - there is only an unofficial wrapper + fwh class to access to the Sqlite3 API developed by SSBBS a chinese FWH user. This is the access mode I'm using.

It's available on http://www2.zzz.com.tw/phpbb2/viewforum ... 99265acf02
It's for this reason I'm interested to know which wrapper is using Rimantes at this moment.

Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 437
Joined: Fri Oct 07, 2005 12:56 PM
Re: SqLite in network
Posted: Fri Oct 28, 2011 05:31 PM
Marco Turco wrote:Hello Rimantes,
I'm using Sqlite and xHarbour since late 2010 in all my products and in network environments without problems.
Generally speaking, you don't need a client-server structure to operate on a network with Sqlite but you should cumulate the write calls inside a Begin Immediate->Commit sequence in order to minimize the file locktime.

To be clear, if you make
INSERT INTO TABLE 1 ....
INSERT INTO TABLE 2 ...
INSERT INTO TABLE 3 ...

you will have 3 lock-unlock loops

Instead, if you make
Begin immediata
INSERT INTO TABLE 1 ....
INSERT INTO TABLE 2 ...
INSERT INTO TABLE 3 ...
Commit

You have just a 1 lock-unlock loop
We have customers with also 25-28 client that operate without problem this way.
Are you using Sqlite3 with odbc or with a wrapper ?


Marco , you provide so PERFECT VALUABLE INFORMATION !!! :-) How fine that is , many thanks to you !

At first , reading info about SqLite and network problems with them I didn't begin a seriuos working ( production ) project with Sqlite . Now I have a new project , small enterpise of production , ~10-12 PC in network . So SqLite for such project is ideal - no server , minimal requirements and administration and etc.

About locking - I'm working ONLY in such manier , as you described - begin ... insert/update one or some tables ... commit . In mine main workplace I'm working with Oracle , inserting/updating I'm doing only in this way some years alreday .

Because I was afraid to begin with SqLite database in network , I begin with fireBird . But now I'll return to SqLite . With FireBird I'm working with hbfbird from harbour\contrib ( I'm working with harbour ) . I was working with hbsqlt3 from harbour\contrib . Also I'll review solution from Ssbbs .

Many thanks to you , Marco !

With best regards !
Rimantas U.
Posts: 654
Joined: Fri Oct 21, 2005 05:54 AM
Re: SqLite in network
Posted: Sat Oct 29, 2011 06:26 AM

Mr.Marco,

You have given very good info regarding Sqlite.

May please know that:

How strong it is in security aspects ?

Can we protect databases with passwords like other flavours of SQL.

I found that SqliteManager is easily opening the Databases without any
security.

Regards,

  • Ramesh Babu