DataEnvironment open tables, sometimes fails.  
Author Message
António Pedro Sousa





PostPosted: Visual FoxPro General, DataEnvironment open tables, sometimes fails. Top

Considerations:

a) This application ran several years in VFP6 without problems.

b) The problem appeared after compilation on VFP9.

c) She runs on VFP9-SP1 - Windows Server 2003 SP1 - Terminal Services.

d) The server holds 1GB RAM; (15 users max in simultaneous)

e) The application is composed by 280 forms; 250 tables in 4 databases. EXE file 10.5MB.

f) All forms hold the following configuration:
.DataEnvironment.AutoCloseTables = .T.
.DataEnvironment.AutoOpenTables = .T.
(No code in DataEnvironment events)

.DataSession = 2 (Private DataSession)

f) The error happens occasionally independently the user, form or server load. (I don't get associate any server load variation.)

g) We registered 3 to 6 error occurrences a day. (Being right that the form where the error happened was executed a lot of dozens of times without problems)

h) NOTE: the base software (VFP9, Windows) was already re-installed.

Error Description:

1) When an any form (e.g. FormA) is called for:

DO FORM FormA

2) Calling FormA:

DataEnvironment didn't open the tables in him contained (e.g. Tabela1, Tabela2, etc). – Without error message.

3) In the form start events (Load or Init) an instruction line as:

SELECT Tabela1

Reply error: 13 - Alias “Tabela1” is not found

4) Performing FormA.RELEASE:

Reply error: 1967 - DataEnvironment Already Closed

5) If we try to repeat the form calling:

DO FORM FormA

Replay erro: 2005-Error Loading file-record number 13. FormB<or one of its members>. Loading form or the data environment: File is in use by another user. (Surprisingly Help numbers this error message with # 1881)

NOTE: I already verified formA.scx with Browse and I didn't find anomalies.

Somebody can give me some TIPS about this problem.

Thanks in advance



Visual FoxPro2  
 
 
dni





PostPosted: Visual FoxPro General, DataEnvironment open tables, sometimes fails. Top

Are you using tables "shared"

Are you using "buffering"

How are you using <nWorkArea> in "SELECT"

What value do you have for AutoCloseTables property,(.F. or .T.)



 
 
Antonio Pedro Sousa





PostPosted: Visual FoxPro General, DataEnvironment open tables, sometimes fails. Top

Are you using tables "shared"

>> Yes

>> <form>.Load > SET EXCLUSIVE OFF 

Are you using "buffering"

>> DataEnvironment.<cursor>.BufferModeOverride=1

>> Form.Buffermode=0

>> form.dataSession=2 - Private

How are you using <nWorkArea> in "SELECT"

>> nWorkArea automatic - Tables open inside DataEnvironment

>> SELECT <alias>

What value do you have for AutoCloseTables property,(.F. or .T.)

 >> AutoCloseTables = .T.

Thanks in advence

B.R. Pedro Sousa


 
 
dni





PostPosted: Visual FoxPro General, DataEnvironment open tables, sometimes fails. Top

First at all try to set AutoCloseTables=.F.

You may check:

http://msdn.microsoft.com/library/default.asp url=/library/en-us/fox7help/html/err1967.asp

If is not working please let me know.



 
 
Antonio Pedro Sousa





PostPosted: Visual FoxPro General, DataEnvironment open tables, sometimes fails. Top

I established <form>.DataEnvironment.DataAutoCloseTables=.F.

The application ran for 16 hours with about 15 users.
Unhappily it didn't result because the error continues with identical frequency

Thank you.


 
 
dni





PostPosted: Visual FoxPro General, DataEnvironment open tables, sometimes fails. Top

You may try to modify BufferModeOverride=1 to 3 or 5 (it should be 3 or 5):

http://msdn2.microsoft.com/en-us/library/wd4eyszb(VS.80).aspx

and Form.Buffermode to 2( if you choose 5 for BufferModeOverride)

http://msdn2.microsoft.com/en-us/library/b3z7b831(VS.80).aspx

I think you may try only small settings because you said the application is runnig ok with vfp6.