Limitation of open files ...

Limitation of open files ...

Postby Rimantas » Wed Apr 13, 2011 10:12 am

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 U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: Limitation of open files ...

Postby gkuhnert » Wed Apr 13, 2011 12:11 pm

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
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Re: Limitation of open files ...

Postby Rimantas » Wed Apr 13, 2011 12:31 pm

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 !
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: Limitation of open files ...

Postby James Bott » Wed Apr 13, 2011 2:45 pm

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Limitation of open files ...

Postby James Bott » Wed Apr 13, 2011 2:50 pm

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  Expand view
#include "fivewin.ch"

function main()
   local i

   for i= 1 to 9999
      use cust new
  next

  ? "done"

return nil
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Limitation of open files ...

Postby Robert Frank » Wed Apr 13, 2011 3:54 pm

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
Robert Frank
User avatar
Robert Frank
 
Posts: 95
Joined: Fri Nov 23, 2007 4:43 am
Location: Gdynia-Poland

Re: Limitation of open files ...

Postby Rimantas » Wed Apr 13, 2011 4:25 pm

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  Expand view


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 !
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: Limitation of open files ...

Postby Rimantas » Wed Apr 13, 2011 4:47 pm

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 !
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: Limitation of open files ...

Postby James Bott » Thu Apr 14, 2011 12:32 am

Rimantas,

> empty browse - no lines . No errors

Maybe there are no records, or no records that meet any filters.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Limitation of open files ...

Postby Enrico Maria Giordano » Thu Apr 14, 2011 8:25 am

James Bott wrote:
Code: Select all  Expand view
#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  Expand view
#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
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Limitation of open files ...

Postby James Bott » Thu Apr 14, 2011 11:17 am

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Limitation of open files ...

Postby Rimantas » Thu Apr 14, 2011 6:54 pm

Solved ... Win 2003 Server security faults ...

Rechecked , renewed - all is working OK ...

With best regards !
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: Limitation of open files ...

Postby James Bott » Thu Apr 14, 2011 9:40 pm

Rimantas,

Great!

Could you explain more what the solution was, so anyone having the same problem later can find the solution here?

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Limitation of open files ...

Postby Rimantas » Fri Apr 15, 2011 4:59 am

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 !
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 104 guests