Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #7705

Re: DBserver 1024 File Limitation Issue

From JohnMartens <martens@tennishulp.info>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: DBserver 1024 File Limitation Issue
Date 2015-01-29 22:45 +0100
Organization A noiseless patient Spider
Message-ID <mae9k0$osj$1@dont-email.me> (permalink)
References (3 earlier) <1303381921.20021107151833@sas-software.nl> <3ca9303d-3202-4895-a3f0-d9bc6252ef20@googlegroups.com> <5d9ec996-f224-4412-8f50-a03895fc75a7@googlegroups.com> <23f373a4-0a72-4420-bbde-bad7c78da177@googlegroups.com> <02aca910-c75f-49d2-8192-fe5ee124e71a@googlegroups.com>

Show all headers | View raw


This is how I count the open servers when I close the shellwindow.
This in case I made some code addition and forget to close one or more 
servers. Doesnt take long to do so.


FOR wAlias := 1 UPTO 1024
	IF .NOT. ( ALIAS(wAlias) == NULL_STRING )
		dwMethresult += 1
	ENDIF
NEXT

John


Johan Nel schreef op 29-1-2015 om 14:58:
> Chris,
>
> No, what I do is to have a STATIC var that basically works on the following principle:
>
> STATIC LOCAL aDbServers AS ARRAY
>
> aDbServers := {}
>
> Then I have a class/function/method that interacts with my open DbServers
>
> FUNCTION ServerOpen(sAlias AS STRING)
>    IF (nPos := Ascan(aDbServers, {|a| a[1] == sAlias})) > 0
>      oDb := aDbServer[nPos, 2]
>      aDbServer[nPos, 3] += 1
>    ELSE
>      oDb := <Open your server>
>      Aadd(aDbServers, {sAlias, oDb, 1})
>    ENDIF
> RETURN oDb
> FUNCTION ServerClose(sAlias AS STRING)
>    IF (nPos := Ascan(aDbServers, {|a| a[1] == sAlias})) = 0
>      // Throw error the server is not open
>    ELSE
>      aDbServers[nPos, 3] -= 1
>      IF aDbServers[nPos, 3] <= 0
>        ADel(aDbServers, nPos)
>      ENDIF
>    ENDIF
> RETURN lClosed
> FUNCTION ServerGet(sAlias)
>    nPos := AScan(aDbServers, {|a| a[1] == sAlias})
> RETURN aDbServers[nPos, 2]
>
> Basically all my interactions with servers are handled by the above three FUNCTIONS that keep track of how many references to each one is active.  You have only 1 "workarea" for each DbServer.
>
> HTH,
>
> Johan
>
> On Thursday, January 29, 2015 at 3:19:31 PM UTC+2, CMc wrote:
>> Thanks Johan.  So is there an easy way to determine the total number of work areas already open?  As a quick fix I could trap the error and let the user know they need to close some other windows.
>>
>> Thanks,
>> Chris
>>
>> On Thursday, January 29, 2015 at 12:12:15 AM UTC-6, Johan Nel wrote:
>>> Chris,
>>>
>>> Yes this is still the limitation.  You need to externalise your connections to tables into a shared collection that handles your interface to the database.  Very unlikely that any process ever will need 1024 open tables to perform a task.
>>>
>>> Regards,
>>>
>>> Johan Nel
>>> Vulcan VIP
>>> Durban, South Africa.
>

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: Re[2]: DBserver 1024 File Limitation Issue CMc <cmccaul@ruddwisdom.com> - 2015-01-28 07:18 -0800
  Re: Re[2]: DBserver 1024 File Limitation Issue Johan Nel <johan.nel@xsinet.co.za> - 2015-01-28 22:12 -0800
    Re: Re[2]: DBserver 1024 File Limitation Issue CMc <cmccaul@ruddwisdom.com> - 2015-01-29 05:19 -0800
      Re: Re[2]: DBserver 1024 File Limitation Issue Johan Nel <johan.nel@xsinet.co.za> - 2015-01-29 05:58 -0800
        Re: DBserver 1024 File Limitation Issue JohnMartens <martens@tennishulp.info> - 2015-01-29 22:45 +0100

csiph-web