Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Hi Bernard,
The "ConnectBusy" property checks the status for the SPT connection handle you are passing to SQLGETPROP. In the example, lnhandle is not busy, but the CURSORGETPROP("ConnectHandle","MyRemoteView") is. Note, in most scenarios, if AllowSimultaneousFetch=.T. for the busy connection handle, you should still be able to execute command through another SPT connection handle that uses the same ODBC connection. In your example, you should still be able to execute something through lnhandle even though the MyRemoteView is still fetching.
Thanks,
Aleksey.
>Hi,
>
>I'm having a little difficulty determining the busyness of a shared connection when using a combination of remote views and cursors created via SQLEXEC calls.
>
>The problem seems to be that whenever I check the busyness of the connection using the statement handle returned from the SQLCONNECT command it always returns .F. when it should return .T.
>
>Say we have a connection set up as follows ;
>
>CREATE CONNECTION Connection1 CONNSTRING 'driver=SQL SERVER;server=(local);uid=SA;pwd=SA;database=MyDataBase'
>
>And a remote view set up in the following way ;
>
>CREATE SQL VIEW MyRemoteView REMOTE CONNECTION Connection1 SHARE AS SELECT * FROM SOMEBIGTABLE
>DBSETPROP('MyRemoteView','View','AllowsimultaneousFetch',.T.)
>DBSETPROP('MyRemoteView','View','Fetchasneeded', .F.)
>DBSETPROP('MyRemoteView','View','Fetchsize', 100)
>DBSETPROP('MyRemoteView', 'View', 'ShareConnection', .T.)
>
>IF I run my view and after the first 100 records are returned, then test the busyness of the connection it works fine. ie
>
>USE MyRemoteView
>llBusy = SQLGETPROP(CURSORGETPROP('ConnectHandle'), "ConnectBusy")
>
>The the llBusy variable equates to TRUE.
>
>Now if I attempt to open the above remote view and then create a statement handle via a call to SQLCONNECT the busy status doesn't behave itself... ie
>
>USE MyRemoteView && begin to download the large recordset
>* now get a handle onto the shared connection
>lnhandle=SQLCONNECT('Connection1',.T.)
>* test to see if the shared connection is busy, it should be!
>llBusy = SQLGETPROP(lnhandle,"ConnectBusy")
>
>The llBusy returns FALSE
>
>My understanding is that the statement handle returned from the SQLCONNECT command is using the shared 'Connection1' connection. The SQLCONNECT command should be using a previously shared connection as I've set the second parameter on the SQLCONNECT to true.
>
>Any body got any ideas?
>
>Thanks, Bernard
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement