Page 1 of 1
Limitation of open files ...
Posted: Wed Apr 13, 2011 10:12 am
by Rimantas
Hi !
Exist something like limitation how many can open dbfs+cdxs in xHarbour ? In one old application I added 3 dbfs + 3 cdxs . Until that number of opens files was 98 , now 104 . I don't know really with what that is related - xharbour , Win 2003 server , clients PC . But in network in some PC browses , that related with that new tables , are empty . In 2 PC all is working OK , in server all is working OK . Where it can be problem ?
With best regards !
Re: Limitation of open files ...
Posted: Wed Apr 13, 2011 12:11 pm
by gkuhnert
Rimantas,
I don't know anything about limitation of files, but you could try these options to isolate the cause of error:
- Open the dbs without applying an order to find out, if an index is corrupted or not usable
- Open the program locally on the computer(s) that are causing the problems to see if it's related to network or to the workstation
- Look if the problem is related to one operating system (for Example only Vista computers show the problem)
- after opening count the number of records (cAlias)->(FCount()) or similar (and write it to a log)
- after applying an order count the records
Maybe this can be of help
Re: Limitation of open files ...
Posted: Wed Apr 13, 2011 12:31 pm
by Rimantas
gkuhnert wrote:
- after opening count the number of records (cAlias)->(FCount()) or similar (and write it to a log)
- after applying an order count the records
I will try this your advices . Small enterprise - 10-15 pc working in network . Win2003 server , and all PC XP , about sp of xp on the clients PCs I don't know . How can be related corrup.index , if in 2 PC browses are working OK and in the server too all is working OK ? I'll test also how it varry with number of opened files . Very strange , such problem I'm seeing first time ...
Regards !
Re: Limitation of open files ...
Posted: Wed Apr 13, 2011 2:45 pm
by James Bott
As suggested already, I would do the initial test on a stand-alone PC. I would also just loop and open the same DBF in different workareas. This will eliminate a lot of issues.
Are you getting an error, and if so, what is it?
Regards,
James
Re: Limitation of open files ...
Posted: Wed Apr 13, 2011 2:50 pm
by James Bott
Rimantas,
I just found this old test in my notes. I just reran it and it opens 9999 files without problem (local PC running XP).
I probably never have more than 20-30 files open at any one time so it has not been an issue for me. I open and close files as needed.
James
Code: Select all
#include "fivewin.ch"
function main()
local i
for i= 1 to 9999
use cust new
next
? "done"
return nil
Re: Limitation of open files ...
Posted: Wed Apr 13, 2011 3:54 pm
by Robert Frank
Rimantas wrote:Hi !
Exist something like limitation how many can open dbfs+cdxs in xHarbour ? In one old application I added 3 dbfs + 3 cdxs . Until that number of opens files was 98 , now 104 . I don't know really with what that is related - xharbour , Win 2003 server , clients PC . But in network in some PC browses , that related with that new tables , are empty . In 2 PC all is working OK , in server all is working OK . Where it can be problem ?
With best regards !
Rimantas
Have you got somethink like this in your application source code?
Function xHBRddInit()
REQUEST DBFCDX
REQUEST DBFFPT
dbSetDriver("DBFCDX")
// REQUEST HB_CODEPAGE_PLWIN
// REQUEST HB_LANG_PLWIN
// hb_SetCodepage( "PLWIN" )
// hb_langselect('PLWIN')
REQUEST HB_CODEPAGE_PL852
REQUEST HB_LANG_PL852
hb_SetCodepage( "PL852" )
hb_langselect('PL852')
SET DBFLOCKSCHEME TO 3
RETURN NIL
I had some problems like yours up to time when I wrote this line
SET DBFLOCKSCHEME TO 3
Re: Limitation of open files ...
Posted: Wed Apr 13, 2011 4:25 pm
by Rimantas
Function xHBRddInit()
REQUEST DBFCDX
REQUEST DBFFPT
dbSetDriver("DBFCDX")
SET DBFLOCKSCHEME TO 3
RETURN NIL
I had some problems like yours up to time when I wrote this line
SET DBFLOCKSCHEME TO 3[/quote]
Wow ! Interesting ! Here is mine :
Code: Select all
ANNOUNCE RDDSYS
REQUEST DBFCDX
function Main()
RddSetDefault( "DBFCDX" )
SET MULTIPLE OFF
SET SCOREBOARD OFF
SET EXCLUSIVE OFF
SET DELETED ON
SET SOFTSEEK OFF
SET AUTOPEN OFF
SET CENTURY ON
SET DATE ANSI
SET EPOCH TO 2000
SET CONFIRM ON
SET ESCAPE ON
SET WRAP ON
SET DATE FORMAT TO "YYYY.MM.DD"
SET DBFLOCKSCHEME TO 2
I'll try with "SET DBFLOCKSCHEME TO 3" . Many thanks !
Regards !
Re: Limitation of open files ...
Posted: Wed Apr 13, 2011 4:47 pm
by Rimantas
James Bott wrote:
Are you getting an error, and if so, what is it?
James , no errors . Customer asked me to do something like archive of old making data . Making data are in 3 dbfs + 3 cdxs . I did 3 new dbfs with 3 cdx analogs to the the main dbfs . Then wroted some code and customer can old data of needful period to transfer to this 3 new dbfs . All is working fine . In menu customer can choose to view/modify data of making as actual period or go to old period data . I use the same mdi child with browse , only from menu I'm passing one parameter to this part of apllication . function makingData( lOldData ) . Then are 3 vars as alias :
cMakingPok := if( lOldData, "MAK_OLD", "MAK_POK" ) and etc ... in browses I use codeBlock ( Hernans browse ) :
{ || ( cMakingPok )->DATA } ...
In mine PC all is working OK , in enterprise server all is working OK , in 2 PC of users in network all is working OK . IN others PC - empty browse - no lines . No errors ... Something mistical ... The first mind was about limitation , but it seems that this isn't true .
Regards !
Re: Limitation of open files ...
Posted: Thu Apr 14, 2011 12:32 am
by James Bott
Rimantas,
> empty browse - no lines . No errors
Maybe there are no records, or no records that meet any filters.
James
Re: Limitation of open files ...
Posted: Thu Apr 14, 2011 8:25 am
by Enrico Maria Giordano
James Bott wrote:Code: Select all
#include "fivewin.ch"
function main()
local i
for i= 1 to 9999
use cust new
next
? "done"
return nil
This is a better test (the above opens only a single file) that still shows no errors:
Code: Select all
#include "fivewin.ch"
function main()
local i
for i= 1 to 9999
use customer alias ( "test" + ltrim( str( i ) ) ) shared new
next
? "done"
return nil
EMG
Re: Limitation of open files ...
Posted: Thu Apr 14, 2011 11:17 am
by James Bott
Enrico,
Thanks for pointing that out. My original test looked similar to yours. I tried to simplify it, but broke it as you pointed out.
James
Re: Limitation of open files ...
Posted: Thu Apr 14, 2011 6:54 pm
by Rimantas
Solved ... Win 2003 Server security faults ...
Rechecked , renewed - all is working OK ...
With best regards !
Re: Limitation of open files ...
Posted: Thu Apr 14, 2011 9:40 pm
by James Bott
Rimantas,
Great!
Could you explain more what the solution was, so anyone having the same problem later can find the solution here?
Regards,
James
Re: Limitation of open files ...
Posted: Fri Apr 15, 2011 4:59 am
by Rimantas
James Bott wrote:
Could you explain more what the solution was, so anyone having the same problem later can find the solution here?
James , I don't know why , but the 3 new dbf files didn't inherited security rights in shared folder . So I added privilleges on this files manually . That is all ...
Regards !