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, 09:51

markmumy's gravatar image

markmumy
263
accept rate: 0%

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).

(21 Oct, 12:33) Volker Barth

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.

(21 Oct, 12:43) markmumy

Here's a WAG: try using a login_procedure to capture information about the failed connection.

(21 Oct, 16:23) Breck Carter

An event of type ConnectFailed would never fire on "Database server connection limit exceeded" as the connection object has not been initialized yet.

permanent link

answered 22 Oct, 09:50

chinmaydixit's gravatar image

chinmaydixit
25126
accept rate: 0%

So is that insider knowledge?

(Just because I would expect such technical statements primarily from SQL Anywhere team members...)

(22 Oct, 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, 10:37) chinmaydixit
Replies hidden
1

So would you see an otherwise failing connection there, say one faling because of wrong credentials?

(22 Oct, 11:01) Volker Barth

Correct. Wrong credentials doesn't show up either but syntax errors does.

(22 Oct, 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, 11:56) JBSchueler
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:

×39

question asked: 21 Oct, 09:51

question was seen: 128 times

last updated: 22 Oct, 11:56