I want to create an event that logs info for any failed connection. I am trying to use the ConnectFailed event type, but that doesn't seem to fire for all failed conditions. In particular, if I have an inbound connection that fails because "Database server connection limit exceeded", I want to capture that as well as other information about the server. My event looks something like this: create event connect_fail_event type "ConnectFailed" handler begin message 'ConnectFailed event fired at '||getdate() to console; end ; If I put in an incorrect user/password then it fires. But if I exceed the number of allows connections, it doesn't fire. Thoughts? asked 21 Oct '21, 09:51 markmumy |
An event of type ConnectFailed would never fire on "Database server connection limit exceeded" as the connection object has not been initialized yet. answered 22 Oct '21, 09:50 chinmaydixit So is that insider knowledge? (Just because I would expect such technical statements primarily from SQL Anywhere team members...)
(22 Oct '21, 10:26)
Volker Barth
I noticed this behavior few years ago in SA16 and did not see a connection id in All Connections in Sybase Central, but yes you are right, SA team members can confirm this.
(22 Oct '21, 10:37)
chinmaydixit
Replies hidden
1
So would you see an otherwise failing connection there, say one faling because of wrong credentials?
(22 Oct '21, 11:01)
Volker Barth
Correct. Wrong credentials doesn't show up either but syntax errors does.
(22 Oct '21, 11:19)
chinmaydixit
1
Perhaps the server properties MaxConnections and ConnCount could be used in some way. I assume that if ConnCount == MaxConnections then the next connection attempt would fail. At least you'd know that you've reached the max. Not quite as good as knowing that a connection attempt failed because you have reached the max.
(22 Oct '21, 11:56)
JBSchueler
|
I'd usually also log the according event parameters like AppInfo, User and SQLCODE via the EVENT_PARAMETER() function. For the connection limit, I had expected SQLCODE -102 (SQLE_TOO_MANY_CONNECTIONS).
Oh, absolutely. That's my plan. However, I can't get the event to fire when we've exceeded too many connections. Capturing any other data is pointless, since there's no event run to do the capture.
Here's a WAG: try using a login_procedure to capture information about the failed connection.