Hi,
After migrating from ASA9 to SA11 ~2 years ago we've noticed that SA11 client reconnects to database automatically after disconnection. Now one of our customers claims about this feature because the software does not work as it was designed to. Users should login again (and some global settings should be read from database) after some idle timeout (when connection is dropped) but in SA11 the connection is regenerated. And I can't find info in the docs about this behavior. Is it controlled by some database or connection option?
Thanks in advance.

asked 19 Nov '12, 02:46

Arthoor's gravatar image

Arthoor
1.1k274058
accept rate: 0%

Do you use connection pooling? Which client technique do you use (ODBC, JDBC ...)?

(19 Nov '12, 05:29) Martin
Replies hidden

ODBC. No, connection pooling is not used in that application.

(19 Nov '12, 05:56) Arthoor

If you happen to be using Powerbuilder for your client software:

We saw a similar problem when moving from SQL Anywhere 9 to 12, which turned out to be a bug in Powerbuilder (http://search.sybase.com/kbx/changerequests?bug_id=639236). This was fixed in Powerbuilder EBF 11.5.1.4843.

permanent link

answered 22 Nov '12, 09:01

Luke's gravatar image

Luke
576111530
accept rate: 33%

That was the case. Thank you very much!

(22 Nov '12, 09:32) Arthoor
1

You're welcome - I logged the bug myself so it's nice to see someone else benefit from the fix.

(22 Nov '12, 09:43) Luke

The SQL Anywhere ODBC client never automatically reconnects a dropped connection, nor has it ever done so. As far as I am aware, none of the SQL Anywhere client interfaces reconnect automatically on a dropped connection.

I know that Interactive SQL can reconnect after a dropped connection, but that is not done at the client API level.

I believe the reconnect that you are seeing must be being done by something higher up that the ODBC driver. That could be the driver manager (although I am not aware of driver managers that reconnect), your application, or your application development tool.

If you can reproduce this you can enable ODBC tracing in the driver manager. In the trace I am pretty sure you will see additional ODBC calls that are reconnecting - demonstrating that the ODBC driver itself is not doing the reconnecting.

permanent link

answered 19 Nov '12, 09:22

Ian%20McHardy's gravatar image

Ian McHardy
3.1k23353
accept rate: 39%

edited 20 Nov '12, 08:50

I start thinking that ODBC driver has no influence to such behavior because it works the same on SA11 server using ASA9 driver.
The application is the same in all my tests. The tests contain the following steps:
1) the application connects to the database;
2) I simply drop that connection through Interactive SQL;
3) the application queries the database with any SQL statement;
4) a new connection appears in sa_conn_info() list
5) but database returns SQLCODE -308.
After that all other queries succeed without errors.
May the reason be somewhere in the database server?

(20 Nov '12, 07:19) Arthoor
2

IMHO you should have a look at the application (or talk to the developers). Very likely the connection is restablished by some layer of the application and not by the database server. We have some logic of that kind in our applications, to recover from short connection failures.

(20 Nov '12, 08:41) Reimer Pods
Replies hidden
3

The SQL Anywhere server does not and cannot automatically re-establish a client connection. It must be done on the client side, and as I said before, it is not done by the ODBC driver itself.

(20 Nov '12, 08:43) Ian McHardy

We can't find anything uncommon in the application. I've put a LOG option into connection string, so I see some differences in ASA9 and SA11 errors.
ASA9 (no effort to connect again):

10:18:55 [ 1149] Connection terminated abnormally; server socket shut down
10:19:11 [ 1149] Communication function i_cs_HandleSQLPresError code 6
10:19:11 [ 1149] Communication function StrmGetInd code 3
10:19:11 [ 1149] Client disconnected

SA11:

10:29:24 [ 3484] Connection terminated abnormally; server socket shut down
10:29:31 [ 3484] Communication function i_cs_HandleSQLPresError code 4
10:29:31 [ 3484] Communication function StrmGetInd code 2
10:29:31 [ 3484] Client disconnected

Thu Nov 22 2012 10:29:31 10:29:31 Attempting to connect using: ...

May these differences help to find the reason of different behavior?

(22 Nov '12, 04:25) Arthoor
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×412
×137
×130

question asked: 19 Nov '12, 02:46

question was seen: 1,942 times

last updated: 22 Nov '12, 09:43