Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
DAVE BALIGO — — source: IIUG Forums & Mailing Lists
Hi,
We are running Informix 12.10.FC9W1X1 on Solaris. Is there a way to limit the
number of DB connections based on User ID? Each user connects to the DB using
their own user ID so we are not using connection pools. We want to limit on
the Informix side and set a max number of connections per user id.
We recently had an application that spun out of control and made thousands of
connections to the DB. We want to prevent this type of issue.
Thank You,
--Dave
Hi Dave.
I see this never had a response. Here is one approach:
CREATE PROCEDURE public.sysdbopen()
DEFINE session_count SMALLINT;
IF USER != 'informix' THEN
SELECT COUNT(*)
INTO session_count
FROM sysmaster:syssessions
WHERE username = USER;
IF session_count > 3 THEN -- set limit here
RAISE EXCEPTION -746, 0, 'Maximum sessions exceeded';
END IF
END IF
END PROCEDURE;
Regards,
Doug Lawry
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.