cancel
Showing results for 
Search instead for 
Did you mean: 

Can I expect any speed improvement for SAConnection between 11.0.1 and 12.0.1?

MCMartin
Participant
3,379

In 11.0.1.2550 I have made the observation that SAConnection is slower than OdbcConnection for simple operations going through tcp/ip like:

OdbcConnection myConnection = new OdbcConnection("dsn=xxx");
myConnection.Open();
OdbcCommand myCommand = myConnection.CreateCommand();
myCommand.CommandText = "SELECT 1"; 
myCommand.ExecuteScalar();
myCommand.Dispose();

With Odbc it needs ~310 ms and uses 29 TCP/IP packets,

with SA it needs ~350 ms and uses 48 TCP/IP packets

Have there been any performance improvements regarding this situation in current versions of the iAnywhere.Data.SQLAnywhere?

Accepted Solutions (1)

Accepted Solutions (1)

ian_mchardy
Product and Topic Expert
Product and Topic Expert

I can think of two improvements that have been made to version 12 that may help.

One is a round trip during the connect sequence has been eliminated for both ODBC and ADO.Net.

The second is connection pooling is enabled by default. In order for connection pooling to be helpful, the same process must connect at least 5 times with the exact same connection string, disconnect and connect again with the same connection string.

MCMartin
Participant
0 Kudos

Thanks for the answer, the exact same connection string is in my opinion not a good choice, as the connection string by default includes the AppInfo which contains even the thread id, so the connection needs to be issued by the same thread otherwise no use for pooling. Or is the relevant connection string just the program provided data?

ian_mchardy
Product and Topic Expert
Product and Topic Expert

The generated portion of the AppInfo string is ignored when determining if two connection strings are the same for connection pooling. If a user specified AppInfo parameter is specified, that is included in the comparison.

VolkerBarth
Contributor
0 Kudos

@Martin: Based on that important (and senseful) detail, I've felt free to edit that answer 🙂

MCMartin
Participant
0 Kudos

thanks, good to have this clarified in the end

Answers (0)