Terminal services or LetoDb?

792 views
Skip to first unread message

Member

unread,
Jun 15, 2017, 4:11:58 PM6/15/17
to Harbour Users
I need some help in understanding what is the best solution for seting up aplication for multiuser enviroment. 

At the moment , I have the file server in LAN with DBF files and the aplication uses them in a shared mode. Everything is working nice and smooth and app uses all the necessary file  locks when updating tables,but sometimes, when multiple tables are changed in one function , some tables dont get updated as they should.I It happens very rarely but in theory with all the file lock it shouldnt happen ever!

As I read online the main reason is the failure in network trafic. I was reading about letodb and its transaction functions and this could be a solution for this problem. 
But if this error occurs because of network trafic failure does it mean that this would never happen if I use concurent Rdp connections on server instead shared folder on LAN?
If I use Windows server or some of the products like Winflector, Thinstuff , OTC Terminal etc? What is your experience ? Did it ever happened to someone with Teminal services?

In case this could happen with Teminal server than there is no question about it- LetoDb is the way to go. 
But if this doesnt happen which solutin is better : Terminal services or Letodb?


Francesco Perillo

unread,
Jun 15, 2017, 5:21:08 PM6/15/17
to harbou...@googlegroups.com
Can you really exclude programming errors?
Have you disabled oplocks?


--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-users+unsubscribe@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Member

unread,
Jun 15, 2017, 5:28:07 PM6/15/17
to Harbour Users
Oplocks disabled.
If it was a programing error it would probably happend more often, now it happens once in every 2000 cases.
The code basicly locks all databases if they are not locked, updates tables and after that unlock all tables.If they are allready locked it sends a message that you need to wait until other user unlocks tables.

Nenad Batoćanin

unread,
Jun 15, 2017, 8:11:26 PM6/15/17
to Harbour Users
We use all three options. For small networks we use standard shared folder via LAN. Some our users use LetoDB, and some use remote access (we use TSPlus). Each approach has advantages and disadvantages.For example, remote access is the safest and quickest, but requires powerful server, remote software, some operation is the more complicated (printing, access to local resources, etc). LetoDB is the "middle" solution and works very well, but not as fast as RD, and still depends of workstations and networks. Failure of the network or the station can still damage the data. Also, there are a couple of bugs that need fixing. 

Regards, NB

Nenad Batoćanin

unread,
Jun 15, 2017, 8:14:47 PM6/15/17
to Harbour Users
BTW, MS disable SMB1 very soon:


Will it have any effect on our application?

NB


On Thursday, June 15, 2017 at 11:21:08 PM UTC+2, fperillo wrote:
Can you really exclude programming errors?
Have you disabled oplocks?

Il 15/giu/2017 22:12, "Member" <starcevi...@gmail.com> ha scritto:
I need some help in understanding what is the best solution for seting up aplication for multiuser enviroment. 

At the moment , I have the file server in LAN with DBF files and the aplication uses them in a shared mode. Everything is working nice and smooth and app uses all the necessary file  locks when updating tables,but sometimes, when multiple tables are changed in one function , some tables dont get updated as they should.I It happens very rarely but in theory with all the file lock it shouldnt happen ever!

As I read online the main reason is the failure in network trafic. I was reading about letodb and its transaction functions and this could be a solution for this problem. 
But if this error occurs because of network trafic failure does it mean that this would never happen if I use concurent Rdp connections on server instead shared folder on LAN?
If I use Windows server or some of the products like Winflector, Thinstuff , OTC Terminal etc? What is your experience ? Did it ever happened to someone with Teminal services?

In case this could happen with Teminal server than there is no question about it- LetoDb is the way to go. 
But if this doesnt happen which solutin is better : Terminal services or Letodb?


--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.

Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.

Member

unread,
Jun 16, 2017, 4:18:12 AM6/16/17
to Harbour Users
Hi Nenad,

Thanks for reply.
So you are saying that with Remote access there is no possibility of partial changed tables? 
And that data damage is possible with  LetoDB ? If it doesnt guarantee data safety what is the purpose of implementing it?

If this is so let summirize  :

1. Remote accesses - safest for data, no possibility of partial update of dbf table, most expensive but overall best solution.
2. Letodb - middle solution, but if it doesnt guarantee complete data safety whats the point?
3. Shared folder- how did you resolved problem with partialy updated tables in this enviroment? I have 7 computers in total so I dont know what do you refer as a small netwok? 

Kind regards

 

Francesco Perillo

unread,
Jun 16, 2017, 5:06:24 AM6/16/17
to harbou...@googlegroups.com

I've been running a software since 1987 on Clipper and then Harbour, about 15 stations, on shared files, with very few cases of lost data... to the tune of 1 per year, and almost all of them due to power outages or users killing the program using the X... I'm sure there are way bigger installations with almost no problem at all.

DBFs don't support transactions natively. Transactions are a series of operations on one or more records of one or more databases. Imagine a sequence of 10 steps. You can flock() all the tables but this doesn't give you any guarantee that the 10 steps are performed. You can keep track of all the steps, with pre and post values, and do a rollback if something goes wrong... not easy, not difficult, probably necessary in some cases...

I'd start adding a log of the steps the transaction performs, to understand if it completes and if not, why.

I'd also try to understand if there are race conditions. Is it possible that another user reads some data from the database during the transaction that later uses to update the data and in the meantime the "transaction" has modified them? With flock() you have the guarantee that nobody else can update the database but all the others can read...

Andreja

unread,
Jun 16, 2017, 7:53:42 AM6/16/17
to Harbour Users
Hi Fperillo,

I am planning to review the code to see is there anything that could affect these events. For example I didnt knew that closing application with X can cause damage in database tables...Thanks for the tip.
I see that you are talking about coding transaction without using Letodb or ADS. Is it possible to post small example so I can see how do you do this?
When somebody flock() all the tables other users are able to read data. How do you avoid that in multiuser enviroment?

Francesco Perillo

unread,
Jun 16, 2017, 8:20:24 AM6/16/17
to harbou...@googlegroups.com
On Fri, Jun 16, 2017 at 1:53 PM, Andreja <starcevi...@gmail.com> wrote:
Hi Fperillo,

I am planning to review the code to see is there anything that could affect these events. For example I didnt knew that closing application with X can cause damage in database tables...Thanks for the tip.

No, I didn't say this. If you have a 10 step process ("transaction") and the user closes the program at step 5, or a lan problem makes the remote filesystem non more reachable, or the program exits with an error, you don't have a "damage" but a "incomplete transaction", where some step were performed and some were not. Or, for example, you may forgot to open an index so that a seek returns wrong records.

If, instead, you actually have a "damage", like data corruption (records or index filled with random data), you should investigate in other directions (probably hardware), since the DBF engine in Harbour is stable and solid.
 
I see that you are talking about coding transaction without using Letodb or ADS. Is it possible to post small example so I can see how do you do this?

I don't do and don't emulate transactions in my code, since I need it in very rare cases and I think it will complicate my code with little benefit.

When somebody flock() all the tables other users are able to read data. How do you avoid that in multiuser enviroment?

A flag file, a record in a db, testing if you can flock a database (and unlocking immediately) before reading... but I'd actually try to rewrite the "transaction" code to not use flock()....

It all depends on how the code was written, what it needs to do, what can be changed, etc etc....

Andreja

unread,
Jun 16, 2017, 8:31:47 AM6/16/17
to Harbour Users
Sorry I said damaged but I meant "incomplete transaction".
Thanks

Nenad Batoćanin

unread,
Jun 16, 2017, 10:10:31 AM6/16/17
to Harbour Users
RA definitely gives maximum security in data processing. We did not notice until now any damage (about 400 users, 2 years). Of course, this excludes hardware problem on the server.

LetoDB has own advantages. Easy installation, no additional software is required, the data on the server are safe from viruses, faster processing compared to the shared folder... LetoDB has transaction, but they have limitations - if you have transaction with more than 10.000 recorde, LetoDB refuses this (I think that this restriction Rolf improved in LetoDBF). 

In shared folder case, we use a special option to test database to find any errors in the database and manually correct them. I know that sounds bad, but it's the only way. In addition, these errors occur *very* rarely. Network with <10 workstation is small :)

Regards, NB

Andreja

unread,
Jun 16, 2017, 3:24:05 PM6/16/17
to Harbour Users
Thanks Nenad!
That asnwers my question comletely.

Do you remebrer did conversion of your aplication from Clipper to Harbour reduced the number of the errors that you mentioned in shared folder? 

Nenad Batoćanin

unread,
Jun 17, 2017, 10:18:43 AM6/17/17
to Harbour Users
Yes. The Clip 5.2 program is working fine, but we occasionally have problems (some internal errors). When we switched to Harbour, all these errors completely disappeared. 

I must say: It has been doing it's job for a long time, and I have used a lot of development tools, but none of them can compare to Harbour. 

Deepest respect to the Harbour authors :)

NB

Maurício Faria

unread,
Jun 19, 2017, 10:17:28 AM6/19/17
to harbou...@googlegroups.com, Nenad Batoćanin
Hi.

> BTW, MS disable SMB1 very soon:
> https://www.bleepingcomputer.com/news/microsoft/microsoft-to-disable-smbv1-in-windows-starting-this-fall/
> Will it have any effect on our application?

I think it will.
I am not absolutely sure but seems that there is no way to disable
oplocks on SMB2 nor SMB3, so, Harbour applications will not run
correctly on a shared folder anymore.

[[]] Maurício Faria

Nenad Batoćanin

unread,
Jun 19, 2017, 10:23:09 AM6/19/17
to Harbour Users, nbato...@wings.rs
Very bad news :(

Mario H. Sabado

unread,
Jun 19, 2017, 11:27:24 AM6/19/17
to harbou...@googlegroups.com
Hi,

Will there still be an impact when using Harbour application on a Linux
server via samba in a windows environment? Does windows SMB still
affects client when running Harbour apps via Linux samba server?

Thanks,
Mario

Francesco Perillo

unread,
Jun 19, 2017, 12:11:05 PM6/19/17
to harbou...@googlegroups.com
Don't understand the question....

I use samba on linux as the shared file server. I did disable oplocks on the server and this makes some jobs way slower, since the client needs to sync every record. I did some very limited tests with oplocks enabled and found no problems but in the end, to be on the safe side, I disabled them.



--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.

Web: http://groups.google.com/group/harbour-users

--- You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-users+unsubscribe@googlegroups.com.

Rick Lipkin

unread,
Jun 20, 2017, 11:57:09 AM6/20/17
to Harbour Users
Andreja 

Been a while since I used .dbf in a lan environment .. what I used to do after I wrote an update to a .Dbf record .. is to issue GoTo Recno() .. or Skip(0) ..
this forces the record pointer to move and in effect flushes the buffers and updated the indexes .. Much like dbCommit(), but without the overhead .. 

Just a quick thought.

Rick Lipkin



Andreja

unread,
Jun 20, 2017, 5:39:29 PM6/20/17
to Harbour Users
Hey Rick,
As far as I know only  dbcommit() makes updates visible to all processes in network.Thanks for suggestion. This is from Viva clipper website :

In a network environment, issuing a GO TO RECNO() or a SKIP0 will flush Clipper’s database and index buffers, but only a COMMIT will flush the buffers and perform a solid-disk write. Thus to insure updates are visible to other processes, you must issue a COMMIT after all database update commands (e.g., APPEND, REPLACE). To insure data integrity, COMMIT should be issued before an UNLOCK operation. Refer to the “Network Programming” chapter for more information on update visibility.

Marcos

unread,
Jun 20, 2017, 7:30:46 PM6/20/17
to Harbour Users, nbato...@wings.rs
Hi,

I suppose that in LetoDb (and probably in NetIO), a process (with multiple threads) centralizes all data reads/writes in server side.

This centralization (all reads/writes happening in server side) avoid Oplocks problems ? 

Thanks,

Marcos

Nenad Batoćanin

unread,
Jun 20, 2017, 9:28:14 PM6/20/17
to Harbour Users, nbato...@wings.rs
Yes, NetIO and LetoDB avoid oplocks completely.
Reply all
Reply to author
Forward
0 new messages