Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ODBC Connection ... is busy
Message
De
11/04/1999 03:55:42
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00205649
Message ID:
00207242
Vues:
15
Hi Josh,

I appreciate your support, I have set all my views to share connection and fetchsize to -1. I do not get the connection busy anymore but I get UPDATE CONFLICT from time to time using the same data so the data are valid.

The program execustes as follow
Select the view
Delete all record
insert all record from an other table

It seems to me that the delete does not complete its task or can not event start it from time to time.

When I select the view is there any chance for the program to start the delete before all records are retreived ?

Should I set the views buffering to 5 rather than 3 ?

I am a bit lost ???

Thanks

Xavier


>Xavier,
>
>If your views are set to share a connection all your views will use the same connection. This is usually desirable because connections use resources on both the client and the server. The one thing you need to do is make sure that you don't try to execute two queries over the same connection at once. If none of your views are set to share connections then there must be something else going on. One possibility is that your connection has Asynchronous Execution set on. This will cause the same problem.
>
>>Hello,
>>
>>Thanks for the reply and I do understand and will try, but one thing is still unclear to me, it seems that those connections returning the message are not even shared !!!! Do I need to make them shared ? What is a shared connection ?
>>
>>Thanks
>>
>>Xavier
>>
>>>Xavier,
>>>
>>>You need to set the view's fetch size before you open it. What's happening here is that when you use the view its fetch size is probably 100 (the default) so execution continues after the first 100 records are retrieved. Setting the FetchSize to -1 at this point will only have an effect if you requery the view. Instead what you need to do is permanantly set the view's fetchsize to -1. If you created the view with the view designer, open it in the designer and choose advanced options from the query menu. Click All for the number of records to fetch at a time. You can also do this in code with:
>>>
>>>DBSETPROP('ViewName', 'View', 'FetchSize', -1)
>>>
>>>>Hi,
>>>>
>>>>I have tried the code below but I still get connection busy on line delete for
>>>>
>>>>Can you help ?
>>>>
>>>>Thanks
>>>>
>>>>
>>>>SELECT SELECT(1)
>>>>USE Jwiplab
>>>>=CURSORSETPROP('FetchSize',-1)
>>>>GO TOP
>>>>DELETE FOR job = curjob
>>>>=TABLEUPDATE(.t.,.t.)
>>>>
>>>>
>>>>>Xavier,
>>>>>
>>>>>ODBC only allows one command to execute at a time over a single connection. If you're using views and you have the FetchSize for the view set to anything other than -1 you can get into a situation where one view is not done requerying when you try to requery or update another view. The easiest thing to do is to just set the FetchSize for each view to -1.
>>>>>
>>>>>>Hi there,
>>>>>>
>>>>>>I am using ODBC to SQL Server to update a few tables. When i run my update prog. I get this error message after a while connection ... is busy. What does it mean and how can I avoid that.
>>>>>>
>>>>>>Many thanks
>>>>>>
>>>>>>Xavier
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform