Re: [RadiusNT] pk_calls and ODBC errors.

Eric ( ejensen@accnorwalk.com )
Thu, 19 Oct 2000 12:09:10 -0400

I tried several combinations and have added the calldate to the key. Still
way too many errors.
When I change the keys do I need to modify the callsinsert trigger? Here is
what I have currently:
>CREATE TRIGGER calls_insert ON dbo.Calls
>FOR INSERT
>AS
> UPDATE sp
> Set sp.Username = i.Username,
> sp.AcctStatusType = i.AcctStatusType,
>sp.CallDate = DateAdd(Second, 0-i.AcctDelayTime, i.CallDate),
>sp.FramedAddress = i.FramedAddress,
>sp.CallerID = i.CallerID,
>sp.ConnectInfo = i.ConnectInfo,
>sp.AcctSessionID = i.AcctSessionID
> 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 sa
> Set sa.TimeLeft = sa.TimeLeft - (i.AcctSessionTime/60 + 1)
> FROM SubAccounts sa, inserted i
> WHERE sa.Login = i.Username
>and sa.TimeLeft <> NULL
>and i.AcctStatusType = 2

Thanks for the help, I need to get this fixed as soon as possible.

Cheers,
Eric Jensen

At 03:16 AM 10/18/2000, you wrote:
>why don we add the CALLDATE field to composiet PK and remove other
>un-neccessoty fields like port/username???
>what are the drawbacks
>
>this will remove Violation of PRIMARY KEY error completely.
>
>suggessions?
>
>- sci
>
>----- Original Message -----
>From: "Eric" <ejensen@accnorwalk.com>
>To: <radiusnt@iea-software.com>
>Sent: Wednesday, October 18, 2000 1:04 AM
>Subject: Re: [RadiusNT] pk_calls and ODBC errors.
>
>
> > I have already deleted all the records out of the calls table, and the
> > errors start almost immediately.
> > I only have records from 10/13/00 and on in there right now.
> >
> > Thanks,
> > Eric
> >
> > At 03:12 PM 10/17/2000, you wrote:
> > >Eric wrote:
> > >
> > > > hello all,
> > > > I know this topic has been talked of many times before, but I have
>tried
> > > > everything I could think of and still cannot fix the problem. We are
> > > > getting too many entries in our logfile with the following error:
> > > > >Tue Oct 17 12:19:03 2000: ODBC Error:23000:2627:
> > > > > [Microsoft][ODBC SQL Server Driver][SQL Server]Violation of PRIMARY
>KEY
> > > > > constraint 'PK_Calls'. Cannot insert duplicate key in object
>'Calls'.
> > > >
> > > > In a matter of 20 minutes there are over 70 of these errors in the
>logfile.
> > > > We are running RadiusNT 2.5.267 on NT.0 as a service. The box is an HP
>LH2
> > > > 266mhz with 128mb ram. We are running SQL 7.0 on the same box.
> > > > We have 16 terminal servers (almost all are PM3's).
> > > >
> > > > Here is what I have tried, what I remember anyways ;o) ...
> > > > -Cleared out the calls table completely.
> > > > -checked to make sure the following order of pk_calls index:
> > > > AcctSessionID
> > > > NasIdentifier
> > > > NasPort
> > > > UserName
> > > > AcctStatusType
> > > > -Also tried several combinations of the above mentioned index
>properties
> > > > (i.e. removed AcctStatusType or NasPort, etc.)
> > > > -I checked to make sure all terminal servers have the secret set and
>is set
> > > > same in Emerald/RadiusNT
> > > > -Check and bumped up memory for SQL.
> > > > -Checked "Manual calls update" in RadAdmin.
> > > > -Ran CheckDB on Emerald.
> > > > -probably a couple other things I can't remember at the moment.
> > > >
> > > > Attached is a 20 minute cut of our logfile, and a copy of radius -x15
>debug
> > > > output.
> > > >
> > > > Does anyone have any more ideas or suggestions?
> > > > I need to get this fixed, it's causing too many problems.
> > > >
> > > > Thanks,
> > > > Eric Jensen
> > > >
> > >
> ------------------------------------------------------------------------
> > > > Name: radprob101700.ZIP
> > > > radprob101700.ZIP Type: Mplayer2 File (application/zip)
> > > > Encoding: base64
> > >
> > >I get this problem after I restart my USR TC Hub.
> > >I have come up with a solution but it requires deleting previous call
>records.
> > >Originally I Trimmed all the old records, only to find it wiped out any
>prepay
> > >information in my Emerald customer files.
> > >The following fix is what I finally came up with.
> > >
> > >THIS WILL DELETE OLD CALL RECORDS. Your billing data will be incorrect if
>you
> > >use anything associated with the amount of time online. I am not
>responsible
> > >for loss of data or loss of revenue. Use at your own risk!
> > >
> > >In Microsoft SQL Server in your Emerald database create a new stored
> > >procedure.
> > >
> > >
> > >
> > >CREATE PROC DeleteStopRecords AS
> > >Delete From Calls Where AcctStatusType <> 1
> > >
> > >Then go into Management/SQL Server Agent and create a new job to invoke
>the
> > >stored procedure.
> > >Do not schedule this.
> > >Simply run the job.
> > >It will delete every existing Stop record in your calls table.
> > >Thus eliminating the duplicate entry error.
> > >
> > >
> > >--
> > >--------------------------------------------------------
> > >Brian Dooley
> > >Classic Service
> > >http://www.classicservice.net
> > >
> > >``````````````````````````````````````````````````````````
> > > - Man cannot survive except by gaining knowledge,
> > > and reason is his only means to gain it.-
> > >
> > > Ayn Rand
> > >
> > >
> > >
> > >For more information about this list (including removal) go to:
> > >http://www.iea-software.com/support/maillists/liststart
> >
> >
> > Advanced Computer Connections, Inc.
> > 9 West Main St.
> > Norwalk, Ohio 44857
> > (419) 668-4080
> >
> >
> > For more information about this list (including removal) go to:
> > http://www.iea-software.com/support/maillists/liststart
> >
>
>
>For more information about this list (including removal) go to:
>http://www.iea-software.com/support/maillists/liststart

Advanced Computer Connections, Inc.
9 West Main St.
Norwalk, Ohio 44857
(419) 668-4080

Please note that this is a User Supported mailing list. This list is
maintained by customers and other technical professionals who work with
our products everyday. If you require technical assistance from IEA
Software's Support Engineers, please check out the Support section of
our Web site at http://www.iea-software.com/support for several support
resource options. Thank you.

For more information about this list (including removal) go to:
http://www.iea-software.com/support/maillists/liststart