Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

problem with AdsGetConnectionType

12 posts in Internet Server Last posting was on 2009-07-11 08:09:53.0Z
Golobrodskiy Igor Posted on 2009-07-06 10:04:04.0Z
From: "Golobrodskiy Igor" <igor@wgsoftpro.com>
Newsgroups: Advantage.Internet_Server
Subject: problem with AdsGetConnectionType
Date: Mon, 6 Jul 2009 13:04:04 +0300
Lines: 19
Organization: WG SoftPro
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: 89.162.137.146
Message-ID: <4a51cca6@solutions.advantagedatabase.com>
X-Trace: 6 Jul 2009 04:06:30 -0700, 89.162.137.146
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!89.162.137.146
Xref: solutions.advantagedatabase.com Advantage.Internet_Server:782
Article PK: 1121036

Hi all,

I create the connection as DNS:INTERNET_PORT\server_alias\test.add.
All work properly but I could not determine that my connect is a AIS one
cause
API AdsGetConnectionType() returns only 2 (ADS_REMOTE_SERVER), not 4
(ADS_AIS_SERVER).

Do I have another way to determine the connection type for my application?

----------
Best regards,
Igor Golobrodskiy
WG SoftPro
E-mail: igor@wgsoftpro.com
URL: http://www.wgsoftpro.com


Alex Wong (ADS) Posted on 2009-07-06 22:15:07.0Z
From: "Alex Wong \(ADS\)" <nobody@sybase.com>
Newsgroups: Advantage.Internet_Server
References: <4a51cca6@solutions.advantagedatabase.com>
Subject: Re: problem with AdsGetConnectionType
Date: Mon, 6 Jul 2009 16:15:07 -0600
Lines: 46
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 10.24.38.144
Message-ID: <4a527731@solutions.advantagedatabase.com>
X-Trace: 6 Jul 2009 16:14:09 -0700, 10.24.38.144
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.144
Xref: solutions.advantagedatabase.com Advantage.Internet_Server:783
Article PK: 1121037

Hi Igor,

The AdsGetConnectionType reports the usConnectionType used when the
AdsConnect60 is called. From the client perspective, the ADS_REMOTE_SERVER
and ADS_AIS_SERVER is almost equivent. I think (though not sure) the only
thing that is affect by the setting is the communication compression. Even
that is also controlled by the server. Normally, the client should not be
concerned with connection type, as long as it is not ADS_LOCAL_SERVER.

The ADS_AIS_SERVER is a left over from the time when there was no support
for authentication, encryption and compression natively on the server, and
there was a middle layer application that handles those functionality. Those
functionalities are now part of the server. The server determined whether
the connection is from Internet or LAN using the port number. If the
connection is on the INTERNET_PORT, the server will treat the connection as
an Internet connection and will require authentication through a data
dictionary regardless the usConnectionType specified by the client.

--
Alex

"Golobrodskiy Igor" <igor@wgsoftpro.com> wrote in message
news:4a51cca6@solutions.advantagedatabase.com...
> Hi all,
>
> I create the connection as DNS:INTERNET_PORT\server_alias\test.add.
> All work properly but I could not determine that my connect is a AIS one
> cause
> API AdsGetConnectionType() returns only 2 (ADS_REMOTE_SERVER), not 4
> (ADS_AIS_SERVER).
>
> Do I have another way to determine the connection type for my application?
>
> ----------
> Best regards,
> Igor Golobrodskiy
> WG SoftPro
> E-mail: igor@wgsoftpro.com
> URL: http://www.wgsoftpro.com
>
>
>


Golobrodskiy Igor Posted on 2009-07-07 08:06:35.0Z
From: "Golobrodskiy Igor" <igor@wgsoftpro.com>
Newsgroups: Advantage.Internet_Server
References: <4a51cca6@solutions.advantagedatabase.com> <4a527731@solutions.advantagedatabase.com>
Subject: Re: problem with AdsGetConnectionType
Date: Tue, 7 Jul 2009 11:06:35 +0300
Lines: 69
Organization: WG SoftPro
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 89.162.137.146
Message-ID: <4a53029d@solutions.advantagedatabase.com>
X-Trace: 7 Jul 2009 02:09:01 -0700, 89.162.137.146
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!89.162.137.146
Xref: solutions.advantagedatabase.com Advantage.Internet_Server:785
Article PK: 1121039

Hi Alex,
thank yor for detailed answer.
Our application is running with REMOTE and AIS connection as well and I
wanted to determine the connection type to optimize our souce code
(cache records, save some data on client side etc. in order to speed up AIS
one). As I undestand I have not any chance to do thus, so I need to use a
special parameters in my app.
Am I right?

----------
Best regards,
Igor Golobrodskiy
WG SoftPro
E-mail: igor@wgsoftpro.com
URL: http://www.wgsoftpro.com


"Alex Wong (ADS)" <nobody@sybase.com> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:4a527731@solutions.advantagedatabase.com...

> Hi Igor,
>
> The AdsGetConnectionType reports the usConnectionType used when the
> AdsConnect60 is called. From the client perspective, the ADS_REMOTE_SERVER
> and ADS_AIS_SERVER is almost equivent. I think (though not sure) the only
> thing that is affect by the setting is the communication compression. Even
> that is also controlled by the server. Normally, the client should not be
> concerned with connection type, as long as it is not ADS_LOCAL_SERVER.
>
> The ADS_AIS_SERVER is a left over from the time when there was no support
> for authentication, encryption and compression natively on the server, and
> there was a middle layer application that handles those functionality.
> Those functionalities are now part of the server. The server determined
> whether the connection is from Internet or LAN using the port number. If
> the connection is on the INTERNET_PORT, the server will treat the
> connection as an Internet connection and will require authentication
> through a data dictionary regardless the usConnectionType specified by the
> client.
>
> --
> Alex
>
>
>
> "Golobrodskiy Igor" <igor@wgsoftpro.com> wrote in message
> news:4a51cca6@solutions.advantagedatabase.com...
>> Hi all,
>>
>> I create the connection as DNS:INTERNET_PORT\server_alias\test.add.
>> All work properly but I could not determine that my connect is a AIS one
>> cause
>> API AdsGetConnectionType() returns only 2 (ADS_REMOTE_SERVER), not 4
>> (ADS_AIS_SERVER).
>>
>> Do I have another way to determine the connection type for my
>> application?
>>
>> ----------
>> Best regards,
>> Igor Golobrodskiy
>> WG SoftPro
>> E-mail: igor@wgsoftpro.com
>> URL: http://www.wgsoftpro.com
>>
>>
>>
>
>


Alex Wong (ADS) Posted on 2009-07-07 15:40:43.0Z
From: "Alex Wong \(ADS\)" <nobody@sybase.com>
Newsgroups: Advantage.Internet_Server
References: <4a51cca6@solutions.advantagedatabase.com> <4a527731@solutions.advantagedatabase.com> <4a53029d@solutions.advantagedatabase.com>
Subject: Re: problem with AdsGetConnectionType
Date: Tue, 7 Jul 2009 09:40:43 -0600
Lines: 82
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: 10.24.38.144
Message-ID: <4a536c3f@solutions.advantagedatabase.com>
X-Trace: 7 Jul 2009 09:39:43 -0700, 10.24.38.144
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.144
Xref: solutions.advantagedatabase.com Advantage.Internet_Server:789
Article PK: 1121043

Yes, you are right. When both REMOTE and AIS are specified, the client will
try the REMOTE first. Since that succeeded, the AdsGetConnectType will
report REMOTE as the connection type.

--
Alex

"Golobrodskiy Igor" <igor@wgsoftpro.com> wrote in message
news:4a53029d@solutions.advantagedatabase.com...
> Hi Alex,
> thank yor for detailed answer.
> Our application is running with REMOTE and AIS connection as well and I
> wanted to determine the connection type to optimize our souce code
> (cache records, save some data on client side etc. in order to speed up
> AIS one). As I undestand I have not any chance to do thus, so I need to
> use a special parameters in my app.
> Am I right?
>
> ----------
> Best regards,
> Igor Golobrodskiy
> WG SoftPro
> E-mail: igor@wgsoftpro.com
> URL: http://www.wgsoftpro.com
>
>
> "Alex Wong (ADS)" <nobody@sybase.com> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
> ÓÌÅÄÕÀÝÅÅ: news:4a527731@solutions.advantagedatabase.com...
>> Hi Igor,
>>
>> The AdsGetConnectionType reports the usConnectionType used when the
>> AdsConnect60 is called. From the client perspective, the
>> ADS_REMOTE_SERVER and ADS_AIS_SERVER is almost equivent. I think (though
>> not sure) the only thing that is affect by the setting is the
>> communication compression. Even that is also controlled by the server.
>> Normally, the client should not be concerned with connection type, as
>> long as it is not ADS_LOCAL_SERVER.
>>
>> The ADS_AIS_SERVER is a left over from the time when there was no support
>> for authentication, encryption and compression natively on the server,
>> and there was a middle layer application that handles those
>> functionality. Those functionalities are now part of the server. The
>> server determined whether the connection is from Internet or LAN using
>> the port number. If the connection is on the INTERNET_PORT, the server
>> will treat the connection as an Internet connection and will require
>> authentication through a data dictionary regardless the usConnectionType
>> specified by the client.
>>
>> --
>> Alex
>>
>>
>>
>> "Golobrodskiy Igor" <igor@wgsoftpro.com> wrote in message
>> news:4a51cca6@solutions.advantagedatabase.com...
>>> Hi all,
>>>
>>> I create the connection as DNS:INTERNET_PORT\server_alias\test.add.
>>> All work properly but I could not determine that my connect is a AIS one
>>> cause
>>> API AdsGetConnectionType() returns only 2 (ADS_REMOTE_SERVER), not 4
>>> (ADS_AIS_SERVER).
>>>
>>> Do I have another way to determine the connection type for my
>>> application?
>>>
>>> ----------
>>> Best regards,
>>> Igor Golobrodskiy
>>> WG SoftPro
>>> E-mail: igor@wgsoftpro.com
>>> URL: http://www.wgsoftpro.com
>>>
>>>
>>>
>>
>>
>
>


Golobrodskiy Igor Posted on 2009-07-09 16:46:48.0Z
From: "Golobrodskiy Igor" <igor@wgsoftpro.com>
Newsgroups: Advantage.Internet_Server
References: <4a51cca6@solutions.advantagedatabase.com> <4a527731@solutions.advantagedatabase.com> <4a53029d@solutions.advantagedatabase.com> <4a536c3f@solutions.advantagedatabase.com>
Subject: Re: problem with AdsGetConnectionType
Date: Thu, 9 Jul 2009 19:46:48 +0300
Lines: 18
Organization: WG SoftPro
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 89.162.137.146
Message-ID: <4a561f8c@solutions.advantagedatabase.com>
X-Trace: 9 Jul 2009 10:49:16 -0700, 89.162.137.146
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!89.162.137.146
Xref: solutions.advantagedatabase.com Advantage.Internet_Server:792
Article PK: 1121046

Hi Alex,

I am sorry but I have another question concerning AIS connection.
Now we are trying to optimize our code for AIS working and I noticed that
client API-function AdsGetMemoLength is slower that other functions (f.e.
AdsGetString) appr. in some times.

When we run our queries on LAN we couldn't see this difference,
but on AIS we have a some problems with reading value of memo fields:(

----------
Best regards,
Igor Golobrodskiy
WG SoftPro
E-mail: igor@wgsoftpro.com
URL: http://www.wgsoftpro.com


Alex Wong (ADS) Posted on 2009-07-09 17:10:27.0Z
From: "Alex Wong \(ADS\)" <nobody@sybase.com>
Newsgroups: Advantage.Internet_Server
References: <4a51cca6@solutions.advantagedatabase.com> <4a527731@solutions.advantagedatabase.com> <4a53029d@solutions.advantagedatabase.com> <4a536c3f@solutions.advantagedatabase.com> <4a561f8c@solutions.advantagedatabase.com>
Subject: Re: problem with AdsGetConnectionType
Date: Thu, 9 Jul 2009 11:10:27 -0600
Lines: 45
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 10.24.38.144
Message-ID: <4a562449@solutions.advantagedatabase.com>
X-Trace: 9 Jul 2009 11:09:29 -0700, 10.24.38.144
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.144
Xref: solutions.advantagedatabase.com Advantage.Internet_Server:793
Article PK: 1121044

Reading memo field data requirs an additional trip to the server. If you are
using DBF table type, then the AdsGetMemoLength requires a trip to the
server as well. ADT table has the memo length in the record so it can be
retrieved without going to the server. AdsGetString when called on regular
character fied does not send any request to the server.

With AIS connection, or any connection that has a long round trip time from
client to server, the way to improve performance is to reduce the number of
requests from client to server. The best way to do that is to shift
processing to the server, using stored procedure for example. If that is not
possible, you have to look a each case individually. For example, if you
call AdsGetMemoLength and then AdsGetString on a memo field, that will
result in two round trips to the server with DBF table. You can reduce that
to one trip by allocating a buffer sufficient for majority of the cases and
just call AdsGetString to read data. You app will then handle the less
common cases when the ADS_INSUFFICIENT_BUFFER (5001) is returned.


--
Alex

"Golobrodskiy Igor" <igor@wgsoftpro.com> wrote in message
news:4a561f8c@solutions.advantagedatabase.com...
> Hi Alex,
>
> I am sorry but I have another question concerning AIS connection.
> Now we are trying to optimize our code for AIS working and I noticed that
> client API-function AdsGetMemoLength is slower that other functions (f.e.
> AdsGetString) appr. in some times.
>
> When we run our queries on LAN we couldn't see this difference,
> but on AIS we have a some problems with reading value of memo fields:(
>
> ----------
> Best regards,
> Igor Golobrodskiy
> WG SoftPro
> E-mail: igor@wgsoftpro.com
> URL: http://www.wgsoftpro.com
>
>


Golobrodskiy Igor Posted on 2009-07-09 17:41:56.0Z
From: "Golobrodskiy Igor" <igor@wgsoftpro.com>
Newsgroups: Advantage.Internet_Server
References: <4a51cca6@solutions.advantagedatabase.com> <4a527731@solutions.advantagedatabase.com> <4a53029d@solutions.advantagedatabase.com> <4a536c3f@solutions.advantagedatabase.com> <4a561f8c@solutions.advantagedatabase.com> <4a562449@solutions.advantagedatabase.com>
Subject: Re: problem with AdsGetConnectionType
Date: Thu, 9 Jul 2009 20:41:56 +0300
Lines: 56
Organization: WG SoftPro
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 89.162.137.146
Message-ID: <4a562cd5@solutions.advantagedatabase.com>
X-Trace: 9 Jul 2009 11:45:57 -0700, 89.162.137.146
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!89.162.137.146
Xref: solutions.advantagedatabase.com Advantage.Internet_Server:794
Article PK: 1121048

Many thanks Alex
but I use only ADT tables in my DD and how I can reduce the number of
requests from client to server in this case?
Can I get AdsGetString w/o AdsGetMemoLength?

> Reading memo field data requirs an additional trip to the server. If you
> are using DBF table type, then the AdsGetMemoLength requires a trip to the
> server as well. ADT table has the memo length in the record so it can be
> retrieved without going to the server. AdsGetString when called on regular
> character fied does not send any request to the server.

>
> With AIS connection, or any connection that has a long round trip time
> from client to server, the way to improve performance is to reduce the
> number of requests from client to server. The best way to do that is to
> shift processing to the server, using stored procedure for example. If
> that is not possible, you have to look a each case individually. For
> example, if you call AdsGetMemoLength and then AdsGetString on a memo
> field, that will result in two round trips to the server with DBF table.
> You can reduce that to one trip by allocating a buffer sufficient for
> majority of the cases and just call AdsGetString to read data. You app
> will then handle the less common cases when the ADS_INSUFFICIENT_BUFFER
> (5001) is returned.
>
>
> --
> Alex
>
>
>
> "Golobrodskiy Igor" <igor@wgsoftpro.com> wrote in message
> news:4a561f8c@solutions.advantagedatabase.com...
>> Hi Alex,
>>
>> I am sorry but I have another question concerning AIS connection.
>> Now we are trying to optimize our code for AIS working and I noticed that
>> client API-function AdsGetMemoLength is slower that other functions (f.e.
>> AdsGetString) appr. in some times.
>>
>> When we run our queries on LAN we couldn't see this difference,
>> but on AIS we have a some problems with reading value of memo fields:(
>>
>> ----------
>> Best regards,
>> Igor Golobrodskiy
>> WG SoftPro
>> E-mail: igor@wgsoftpro.com
>> URL: http://www.wgsoftpro.com
>>
>>
>
>


Golobrodskiy Igor Posted on 2009-07-09 17:43:32.0Z
From: "Golobrodskiy Igor" <igor@wgsoftpro.com>
Newsgroups: Advantage.Internet_Server
References: <4a51cca6@solutions.advantagedatabase.com> <4a527731@solutions.advantagedatabase.com> <4a53029d@solutions.advantagedatabase.com> <4a536c3f@solutions.advantagedatabase.com> <4a561f8c@solutions.advantagedatabase.com> <4a562449@solutions.advantagedatabase.com>
Subject: Re: problem with AdsGetConnectionType
Date: Thu, 9 Jul 2009 20:43:32 +0300
Lines: 57
Organization: WG SoftPro
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 89.162.137.146
Message-ID: <4a562cd7@solutions.advantagedatabase.com>
X-Trace: 9 Jul 2009 11:45:59 -0700, 89.162.137.146
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!89.162.137.146
Xref: solutions.advantagedatabase.com Advantage.Internet_Server:795
Article PK: 1121049

Many thanks Alex
but I use only ADT tables in my DD and how I can reduce the number of
requests from client to server in this case?
Can I get AdsGetString w/o AdsGetMemoLength?

> Reading memo field data requirs an additional trip to the server. If you
> are using DBF table type, then the AdsGetMemoLength requires a trip to the
> server as well. ADT table has the memo length in the record so it can be
> retrieved without going to the server. AdsGetString when called on regular
> character fied does not send any request to the server.

>
> With AIS connection, or any connection that has a long round trip time
> from client to server, the way to improve performance is to reduce the
> number of requests from client to server. The best way to do that is to
> shift processing to the server, using stored procedure for example. If
> that is not possible, you have to look a each case individually. For
> example, if you call AdsGetMemoLength and then AdsGetString on a memo
> field, that will result in two round trips to the server with DBF table.
> You can reduce that to one trip by allocating a buffer sufficient for
> majority of the cases and just call AdsGetString to read data. You app
> will then handle the less common cases when the ADS_INSUFFICIENT_BUFFER
> (5001) is returned.
>
>
> --
> Alex
>
>
>
> "Golobrodskiy Igor" <igor@wgsoftpro.com> wrote in message
> news:4a561f8c@solutions.advantagedatabase.com...
>> Hi Alex,
>>
>> I am sorry but I have another question concerning AIS connection.
>> Now we are trying to optimize our code for AIS working and I noticed that
>> client API-function AdsGetMemoLength is slower that other functions (f.e.
>> AdsGetString) appr. in some times.
>>
>> When we run our queries on LAN we couldn't see this difference,
>> but on AIS we have a some problems with reading value of memo fields:(
>>
>> ----------
>> Best regards,
>> Igor Golobrodskiy
>> WG SoftPro
>> E-mail: igor@wgsoftpro.com
>> URL: http://www.wgsoftpro.com
>>
>>
>
>


Alex Wong (ADS) Posted on 2009-07-10 00:04:03.0Z
From: "Alex Wong \(ADS\)" <nobody@sybase.com>
Newsgroups: Advantage.Internet_Server
References: <4a51cca6@solutions.advantagedatabase.com> <4a527731@solutions.advantagedatabase.com> <4a53029d@solutions.advantagedatabase.com> <4a536c3f@solutions.advantagedatabase.com> <4a561f8c@solutions.advantagedatabase.com> <4a562449@solutions.advantagedatabase.com> <4a562cd7@solutions.advantagedatabase.com>
Subject: Re: problem with AdsGetConnectionType
Date: Thu, 9 Jul 2009 18:04:03 -0600
Lines: 74
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 10.24.38.144
Message-ID: <4a568538@solutions.advantagedatabase.com>
X-Trace: 9 Jul 2009 18:03:04 -0700, 10.24.38.144
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.144
Xref: solutions.advantagedatabase.com Advantage.Internet_Server:796
Article PK: 1121050

You will need to identify what API is causing the request from the client.
This can be done by monitoring the network using a sniffer such as ethereal
or wireshark. And then think of possible alternative.

--
Alex

"Golobrodskiy Igor" <igor@wgsoftpro.com> wrote in message
news:4a562cd7@solutions.advantagedatabase.com...
> Many thanks Alex
> but I use only ADT tables in my DD and how I can reduce the number of
> requests from client to server in this case?
> Can I get AdsGetString w/o AdsGetMemoLength?
>
>
>> Reading memo field data requirs an additional trip to the server. If you
>> are using DBF table type, then the AdsGetMemoLength requires a trip to
>> the
>> server as well. ADT table has the memo length in the record so it can be
>> retrieved without going to the server. AdsGetString when called on
>> regular
>> character fied does not send any request to the server.
>
>
>>
>> With AIS connection, or any connection that has a long round trip time
>> from client to server, the way to improve performance is to reduce the
>> number of requests from client to server. The best way to do that is to
>> shift processing to the server, using stored procedure for example. If
>> that is not possible, you have to look a each case individually. For
>> example, if you call AdsGetMemoLength and then AdsGetString on a memo
>> field, that will result in two round trips to the server with DBF table.
>> You can reduce that to one trip by allocating a buffer sufficient for
>> majority of the cases and just call AdsGetString to read data. You app
>> will then handle the less common cases when the ADS_INSUFFICIENT_BUFFER
>> (5001) is returned.
>>
>>
>> --
>> Alex
>>
>>
>>
>> "Golobrodskiy Igor" <igor@wgsoftpro.com> wrote in message
>> news:4a561f8c@solutions.advantagedatabase.com...
>>> Hi Alex,
>>>
>>> I am sorry but I have another question concerning AIS connection.
>>> Now we are trying to optimize our code for AIS working and I noticed
>>> that
>>> client API-function AdsGetMemoLength is slower that other functions
>>> (f.e.
>>> AdsGetString) appr. in some times.
>>>
>>> When we run our queries on LAN we couldn't see this difference,
>>> but on AIS we have a some problems with reading value of memo fields:(
>>>
>>> ----------
>>> Best regards,
>>> Igor Golobrodskiy
>>> WG SoftPro
>>> E-mail: igor@wgsoftpro.com
>>> URL: http://www.wgsoftpro.com
>>>
>>>
>>
>>
>
>
>


Golobrodskiy Igor Posted on 2009-07-10 06:26:34.0Z
From: "Golobrodskiy Igor" <igor@wgsoftpro.com>
Newsgroups: Advantage.Internet_Server
References: <4a51cca6@solutions.advantagedatabase.com> <4a527731@solutions.advantagedatabase.com> <4a53029d@solutions.advantagedatabase.com> <4a536c3f@solutions.advantagedatabase.com> <4a561f8c@solutions.advantagedatabase.com> <4a562449@solutions.advantagedatabase.com> <4a562cd7@solutions.advantagedatabase.com> <4a568538@solutions.advantagedatabase.com>
Subject: Re: problem with AdsGetConnectionType
Date: Fri, 10 Jul 2009 09:26:34 +0300
Lines: 151
Organization: WG SoftPro
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_000E_01CA0140.84816E10"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: 89.162.137.146
Message-ID: <4a56dfad@solutions.advantagedatabase.com>
X-Trace: 10 Jul 2009 00:29:01 -0700, 89.162.137.146
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!89.162.137.146
Xref: solutions.advantagedatabase.com Advantage.Internet_Server:797
Article PK: 1121052

Hi Alex
 
I've done some following tests:
 
My query is
SELECT {static} name,value as value FROM docsetup WHERE id=2
(name is char field and value is memo in DOCSETUP.ADT)
 
Then I do a loop
 
while not AdsAtEOF()
      ........
      AdsSkip(1)
end while
This code runs 0.22 sec for 22 records and 3.50 sec for 1400 ones
 
When I do
 
while not AdsAtEOF()
      AdsGetString('name',,)
      AdsSkip(1)
end while

I had -  0.25 and 4.00 sec accordingly
 
whereas
 
while not AdsAtEOF(1)
      AdsGetMemoLength('value',,,)
      AdsSkip(1)
end while
I had -  1.30 and >61.00 sec accordingly
 
 
P.S. I used AdsCacheRecords(25) for all these tests.

 

----------
Best regards,
Igor Golobrodskiy
WG SoftPro
E-mail: igor@wgsoftpro.com
URL: http://www.wgsoftpro.com
 
 


Alex Wong (ADS) Posted on 2009-07-10 22:31:34.0Z
From: "Alex Wong \(ADS\)" <nobody@sybase.com>
Newsgroups: Advantage.Internet_Server
References: <4a51cca6@solutions.advantagedatabase.com> <4a527731@solutions.advantagedatabase.com> <4a53029d@solutions.advantagedatabase.com> <4a536c3f@solutions.advantagedatabase.com> <4a561f8c@solutions.advantagedatabase.com> <4a562449@solutions.advantagedatabase.com> <4a562cd7@solutions.advantagedatabase.com> <4a568538@solutions.advantagedatabase.com> <4a56dfad@solutions.advantagedatabase.com>
Subject: Re: problem with AdsGetConnectionType
Date: Fri, 10 Jul 2009 16:31:34 -0600
Lines: 226
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_0008_01CA017B.E477C4A0"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: 10.24.38.144
Message-ID: <4a57c10a@solutions.advantagedatabase.com>
X-Trace: 10 Jul 2009 16:30:34 -0700, 10.24.38.144
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.144
Xref: solutions.advantagedatabase.com Advantage.Internet_Server:798
Article PK: 1121051

Sorry, I was wrong about ADT not going to the server to get the memo length. It still does but the memo data is read from the server to the client at the same time. If you call AdsGetString() after AdsGetMemoLength() to read the data, there should be no significant increase in the total time.
 
If you want to read the memo data in the loop, I am afraid that this is probably as fast as it gets given the long round trip time. However, if you are simply interested in the amount of data in the memo field, you can use the following query:
 
SELECT name,value as value, length( value ) as memolength FROM docsetup WHERE id=2
Then instead of using AdsGetMemoLength to get the data length in the memo field, you can use
 
AdsGetLong( ..., 'memolength', ... )
 
Implemented this way, there will be no additional request across the network to simply get the lenght of the memo field.
 
--
Alex
 
 
"Golobrodskiy Igor" <igor@wgsoftpro.com> wrote in message news:4a56dfad@solutions.advantagedatabase.com...
Hi Alex
 
I've done some following tests:
 
My query is
SELECT {static} name,value as value FROM docsetup WHERE id=2
(name is char field and value is memo in DOCSETUP.ADT)
 
Then I do a loop
 
while not AdsAtEOF()
      ........
      AdsSkip(1)
end while
This code runs 0.22 sec for 22 records and 3.50 sec for 1400 ones
 
When I do
 
while not AdsAtEOF()
      AdsGetString('name',,)
      AdsSkip(1)
end while

I had -  0.25 and 4.00 sec accordingly
 
whereas
 
while not AdsAtEOF(1)
      AdsGetMemoLength('value',,,)
      AdsSkip(1)
end while
I had -  1.30 and >61.00 sec accordingly
 
 
P.S. I used AdsCacheRecords(25) for all these tests.

 

----------
Best regards,
Igor Golobrodskiy
WG SoftPro
E-mail: igor@wgsoftpro.com
URL: http://www.wgsoftpro.com
 
 


Golobrodskiy Igor Posted on 2009-07-11 08:09:53.0Z
From: "Golobrodskiy Igor" <igor@wgsoftpro.com>
Newsgroups: Advantage.Internet_Server
References: <4a51cca6@solutions.advantagedatabase.com> <4a527731@solutions.advantagedatabase.com> <4a53029d@solutions.advantagedatabase.com> <4a536c3f@solutions.advantagedatabase.com> <4a561f8c@solutions.advantagedatabase.com> <4a562449@solutions.advantagedatabase.com> <4a562cd7@solutions.advantagedatabase.com> <4a568538@solutions.advantagedatabase.com> <4a56dfad@solutions.advantagedatabase.com> <4a57c10a@solutions.advantagedatabase.com>
Subject: Re: problem with AdsGetConnectionType
Date: Sat, 11 Jul 2009 11:09:53 +0300
Lines: 282
Organization: WG SoftPro
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_000A_01CA0218.1DA95DF0"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: 89.162.137.146
Message-ID: <4a584966@solutions.advantagedatabase.com>
X-Trace: 11 Jul 2009 02:12:22 -0700, 89.162.137.146
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!89.162.137.146
Xref: solutions.advantagedatabase.com Advantage.Internet_Server:799
Article PK: 1121054

Many thanks, Alex.
 
You are absolutely right (as usual:)).
The total time AdsGetMemoLength() and AdsGetString() for memo field is constant because the first one read all data to the client.
So when I tryed your query I had the same result - AdsGetString() spend maybe all this time.
When I call AdsGetString() after AdsGetMemoLength() it processed more faster (maybe the data is already on client side)

----------
Best regards,
Igor Golobrodskiy
WG SoftPro
E-mail: igor@wgsoftpro.com
URL: http://www.wgsoftpro.com
 
 
"Alex Wong (ADS)" <nobody@sybase.com> сообщил/сообщила в новостях следующее: news:4a57c10a@solutions.advantagedatabase.com...
Sorry, I was wrong about ADT not going to the server to get the memo length. It still does but the memo data is read from the server to the client at the same time. If you call AdsGetString() after AdsGetMemoLength() to read the data, there should be no significant increase in the total time.
 
If you want to read the memo data in the loop, I am afraid that this is probably as fast as it gets given the long round trip time. However, if you are simply interested in the amount of data in the memo field, you can use the following query:
 
SELECT name,value as value, length( value ) as memolength FROM docsetup WHERE id=2
Then instead of using AdsGetMemoLength to get the data length in the memo field, you can use
 
AdsGetLong( ..., 'memolength', ... )
 
Implemented this way, there will be no additional request across the network to simply get the lenght of the memo field.
 
--
Alex
 
 
"Golobrodskiy Igor" <igor@wgsoftpro.com> wrote in message news:4a56dfad@solutions.advantagedatabase.com...
Hi Alex
 
I've done some following tests:
 
My query is
SELECT {static} name,value as value FROM docsetup WHERE id=2
(name is char field and value is memo in DOCSETUP.ADT)
 
Then I do a loop
 
while not AdsAtEOF()
      ........
      AdsSkip(1)
end while
This code runs 0.22 sec for 22 records and 3.50 sec for 1400 ones
 
When I do
 
while not AdsAtEOF()
      AdsGetString('name',,)
      AdsSkip(1)
end while

I had -  0.25 and 4.00 sec accordingly
 
whereas
 
while not AdsAtEOF(1)
      AdsGetMemoLength('value',,,)
      AdsSkip(1)
end while
I had -  1.30 and >61.00 sec accordingly
 
 
P.S. I used AdsCacheRecords(25) for all these tests.

 

----------
Best regards,
Igor Golobrodskiy
WG SoftPro
E-mail: igor@wgsoftpro.com
URL: http://www.wgsoftpro.com