Re: Emerald Database

Dale E. Reed Jr. ( (no email) )
Fri, 21 Aug 1998 11:02:57 -0700

Rick Knospler wrote:
> Here is an example of the problem I am having.. RadiusNT 2.5 is running on
> the SQL server itself.
> I logged in, and connected, then disconnected immediately.. There was a
> stop record generated when I disconnected.. Then, I tried to reconnect and
> was rejected because the stop record was not processed properly.. If you
> can shed any light on this, I'd greatly appreciate it..

Check the trigger on your calls table. The update for the ServerPorts
should be a ">=" rather than just a ">". If its just the later, you'll
have the problem you describe.

DROP Trigger calls_insert

CREATE TRIGGER calls_insert ON dbo.Calls
UPDATE ServerPorts
Set sp.UserName = i.UserName,
sp.AcctStatusType = i.AcctStatusType,
sp.CallDate = DateAdd(Second, 0-i.AcctDelayTime, i.CallDate),
sp.FramedAddress = i.FramedAddress
FROM Servers s, ServerPorts sp, inserted i
WHERE s.IPAddress = i.NASIdentifier AND
s.ServerID = sp.ServerID AND
sp.Port = i.NASPort AND
(DateAdd(Second, 0-i.AcctDelayTime, i.CallDate) >= sp.CallDate OR
sp.CallDate IS NULL)

UPDATE SubAccounts
Set sa.TimeLeft = sa.TimeLeft - (i.AcctSessionTime/60 +
FROM SubAccounts sa, inserted i
WHERE sa.login = i.UserName
and sa.TimeLeft <> NULL
and i.AcctStatusType = 2

-- Dale E. Reed Jr.  (       IEA Software, Inc.      |  RadiusNT, Emerald, and NT FAQs Internet Solutions for Today  |