Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 9 of 9 total |
how many clients are connected to a table |
Fri, Feb 20 2009 4:41 AM | Permanent Link |
"Carlos" | You can tell how many clients are connected to a table in a 3.30 application
in local network , without using DBSRVR ? The maximum number to be tested is less than 20 clients. Thanks Carlos |
Fri, Feb 20 2009 5:12 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Carlos
>You can tell how many clients are connected to a table in a 3.30 application >in local network , without using DBSRVR ? Only if you manage it yourself. There's nothing in fileserver mode that can give you the information. Roy Lambert [Team Elevate] |
Fri, Feb 20 2009 9:28 AM | Permanent Link |
"Robert" | "Carlos" <carlos@noemail.com> wrote in message news:6FDE2C71-3319-43F6-8E8F-6F0B4E334B2B@news.elevatesoft.com... > You can tell how many clients are connected to a table in a 3.30 > application in local network , without using DBSRVR ? > The maximum number to be tested is less than 20 clients. You have to code it yourslf, but it is pretty easy. Using semaphores, you add a semaphore every time a user is connected, and delete the sempahore when they log out. Sempahores are cleaned up automatically if the app crashes, so there will be no garbage left over. To count number of users, you attempt to place semaphores form 1 to 20, every time you fail it is because there is an active user. If you want to do it, post again and I'll give you a couple of code examples. > > Thanks > > Carlos > > |
Fri, Feb 20 2009 10:49 AM | Permanent Link |
"Carlos" | "Robert" <ngsemail2005withoutthis@yahoo.com.ar> ha scritto nel messaggio news:CFD719B9-6236-4AA4-AB54-9F080E4DDC62@news.elevatesoft.com... > > "Carlos" <carlos@noemail.com> wrote in message > news:6FDE2C71-3319-43F6-8E8F-6F0B4E334B2B@news.elevatesoft.com... >> You can tell how many clients are connected to a table in a 3.30 >> application in local network , without using DBSRVR ? >> The maximum number to be tested is less than 20 clients. > > > You have to code it yourslf, but it is pretty easy. Using semaphores, you > add a semaphore every time a user is connected, and delete the sempahore > when they log out. Sempahores are cleaned up automatically if the app > crashes, so there will be no garbage left over. > > To count number of users, you attempt to place semaphores form 1 to 20, > every time you fail it is because there is an active user. > > If you want to do it, post again and I'll give you a couple of code > examples. > >> >> Thanks >> >> Carlos >> >> > > I write this snippet of code to active and count the semaphore The test for the latest clinet is a bit slow. procedure TForm1.SemaphoreClick(Sender: TObject); Var i: integer; begin DBISAMSession1.LockWaitTime:=1; DBISAMSession1.LockRetryCount:=1; for i:=1 to 20 do begin if UTENTI.LOCKSEMAPHORE(I) then break; end; DBISAMSession1.LockRetryCount:=15; DBISAMSession1.LockWaitTime:=100; Memo1.Lines.Add(intToStr(i)); end; |
Fri, Feb 20 2009 11:29 AM | Permanent Link |
"Robert" | "Carlos" <carlos@noemail.com> wrote in message news:E0655F81-65BB-4C7F-9DAA-4551A8E8C607@news.elevatesoft.com... > >> > > I write this snippet of code to active and count the semaphore > The test for the latest clinet is a bit slow. > I'm not sure what "a bit slow" is, but I just run your code (similar, anyway) putting 20 sempahores on a table, and it is instantaneous. Are you sure you are modifying the right session for the wait time and retry count? I set 20 semaphores, and then looped trying to set them again (basically going thru the wait time for each one) and both operations were instantaneous. Keep in mind that you will have to reset the semaphores you don't want, as in the code below. function CountActiveUsers : integer; var i : integer; begin // modify session result := 0; for i := 1 to 20 do if Table.LockSempahore(i) then Table.UnlockSemaphore(i) else inc(Result); // reset session end; Robert > > procedure TForm1.SemaphoreClick(Sender: TObject); > Var > i: integer; > begin > DBISAMSession1.LockWaitTime:=1; > DBISAMSession1.LockRetryCount:=1; > > for i:=1 to 20 do begin > if UTENTI.LOCKSEMAPHORE(I) then break; > end; > > DBISAMSession1.LockRetryCount:=15; > DBISAMSession1.LockWaitTime:=100; > > Memo1.Lines.Add(intToStr(i)); > end; > > > |
Fri, Feb 20 2009 2:14 PM | Permanent Link |
David | I wish Tim would add this or more specifically, an "official" way to tell
how many people were logged into DBISAM and a way to set a limit to the connections. It seems this question is asked relatively frequently and the answer is always "It is easy. Do this." Plus with the paid support plans, it would be an easy way to add a feature. (wink, wink) On 2/20/09 9:27 AM, in article CFD719B9-6236-4AA4-AB54-9F080E4DDC62@news.elevatesoft.com, "Robert" <ngsemail2005withoutthis@yahoo.com.ar> wrote: > > "Carlos" <carlos@noemail.com> wrote in message > news:6FDE2C71-3319-43F6-8E8F-6F0B4E334B2B@news.elevatesoft.com... >> You can tell how many clients are connected to a table in a 3.30 >> application in local network , without using DBSRVR ? >> The maximum number to be tested is less than 20 clients. > > > You have to code it yourslf, but it is pretty easy. Using semaphores, you > add a semaphore every time a user is connected, and delete the sempahore > when they log out. Sempahores are cleaned up automatically if the app > crashes, so there will be no garbage left over. > > To count number of users, you attempt to place semaphores form 1 to 20, > every time you fail it is because there is an active user. > > If you want to do it, post again and I'll give you a couple of code > examples. > >> >> Thanks >> >> Carlos >> >> > > |
Mon, Feb 23 2009 9:21 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | David,
<< I wish Tim would add this or more specifically, an "official" way to tell how many people were logged into DBISAM and a way to set a limit to the connections. It seems this question is asked relatively frequently and the answer is always "It is easy. Do this." >> I did add this - in ElevateDB. I'd have to look into whether this is possible in DBISAM or not. There are some specific things about ElevateDB that allow it to uniquely track sessions so as to get an accurate count and not see duplicates. -- Tim Young Elevate Software www.elevatesoft.com |
Tue, Feb 24 2009 2:17 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Tim
><< I wish Tim would add this or more specifically, an "official" way to tell >how many people were logged into DBISAM and a way to set a limit to the >connections. It seems this question is asked relatively frequently and the > answer is always "It is easy. Do this." >> > >I did add this - in ElevateDB. I thought that was only c/s not f/s Roy Lambert |
Tue, Feb 24 2009 9:49 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Roy,
<< I thought that was only c/s not f/s >> No, it's both. The only thing missing (that will be available in 2.03) is the bit about excluding certain sessions from the count. We need for the job execution session in the server, and developers need it for threaded background access from their application. -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Sunday, May 5, 2024 at 07:30 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |