>I set FetchSize=-1 for all CursorAdapter objects and now the form work as I expected. Thanks!
>I am curious why you prefer second method (dedicated ODBC connections).
>For me the method has two seriuos disadvantages:
>- it is not comfortable in case when several cursors participate in the same transaction (you have to bind conections using token)
>- it seems that form with many cursor will consume more SQLServer resources than it is needed (I wonder if it could cause exceeding MSDE limits).
>
Hi Jozef,
Depending on result set size and network connection speed, fetch at once (FetchSize=-1) may take significant amount of time. If you have several CursorAdapter object like this on the form, the form instantiation may be very slow.
If all result sets are "small" and you are satisfied with how fast your form is instantiated then FetchSize=-1 for all CursorAdapter objects is a perfect solution.
Jim's solution work's too, it will work slower, but it'll better handle scenarios when some CursorAdapter objects don't use FetchSize=-1.
Another way to go, especially when the form instantiation is very slow, is to use dedicated connection/statement handles for each CursorAdapter object. Here you also have a choice:
a) To use dedicated ODBC connection for each CursorAdapter object. Advantage - you don't have to worry about FetchSize and AllowSimultaneousFetch settings. Disadvantage - multiple connections to the server.
b) To use the same "shared" ODBC connection in conjunction with dedicated ODBC statement handle (for more information about shared connection see help topic for SQLCONNECT function) for each CursorAdapter. To make sure this approach always works, AllowSimultaneousFetch=.T. must be used for all CursorAdapter objects. All CursorAdapter objects will share one connection to the server, all will be successfully "filled", form instantiation will be fast, but later it may run slower because fetch for AllowSimultaneousFetch=.T. is slower.
There is no single approach that will work perfectly for all scenarios, which one to use should be decided on a case by case basis.
Thanks,
Aleksey.
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