Re: Error 25081: Incorrectly generating identities after a merge

From: John Kendrick (jkendrick_at_DONTneo.SPAMrr.com)
Date: 10/25/04


Date: Mon, 25 Oct 2004 11:57:53 -0400

Kevin,

First, appreciate your help. I tried compacting the database after the
synchronization and the error is still present.

I started using the profiler to examine the synchronization.

Prior to create I checked the publication's Identity Range Tab for one of
the failing tables (last_product_sel):
Identity Tab show next range value 437000

Creating a new database (log record from SQL Profiler):
declare @P1 bigint
set @P1=438000
declare @P2 bigint
set @P2=1000
declare @P3 int
set @P3=80
exec

"distribution"."dbo"."sp_MSfetchAdjustidentityrange";1 @publisher =
N'SERVER02', @publisher_db = N'testdb',

@tablename = N'last_product_sel', @adjust_only = 1, @next_seed = @P1 output,
@range = @P2 output, @threshold = @P3

output
select @P1, @P2, @P3

After the create I checked the publication's Identity Range Tab for one of
the failing tables (last_product_sel):
Identity Tab show next range value 438000
At this point I can INSERT new rows.

Synchronized the database (log record from SQL Profiler):
declare @P1 bigint
set @P1=439000
declare @P2 bigint
set @P2=1000
declare @P3 int
set @P3=80
exec

"distribution"."dbo"."sp_MSfetchAdjustidentityrange";1 @publisher =
N'SERVER02', @publisher_db = N'testdb',

@tablename = N'last_product_sel', @adjust_only = 1, @next_seed = @P1 output,
@range = @P2 output, @threshold = @P3

output
select @P1, @P2, @P3

After the synchronize I checked the publication's Identity Range Tab for one
of the failing tables (last_product_sel):
Identity Tab show next range value 439000

The INSERTs now fail with the 25081 error when trying to insert a record
with a generated value of 439000.

Since I only inserted the one record after the create, the threshold for the
identity range was not been met, yet during the synchronization a new range
was allocated. I think this is a configuration problem on the server. Could
you recommend tables to examine and additional items to watch in the
profiler.

"Kevin Collins (MS - SQL Mobile)" <kevincol@online.microsoft.com> wrote in
message news:eH6T%23LFuEHA.2800@tk2msftngp13.phx.gbl...
> Compacting the database will not move the identity range up. So you are
safe
> to compact the database.
>
> You should not need to compact the database after every synchronization.
> I'm just trying to eliminate any potential that there is something messed
up
> in one of the internal tracking tables. If that doesn't solve the problem
> then we can investigate other areas.
>
>
> "John Kendrick" <jkendrick@DONTneo.SPAMrr.com> wrote in message
> news:%23plz3q5tEHA.200@TK2MSFTNGP11.phx.gbl...
> > This happens on all the databases that I synchronize (using the .NET
> > application, the eVB application works fine). Also pattern occurs after
> > every synchronization I do that doesn't use the
> > ReinitializeSubscription().
> >
> > I have never attempted to compact the database. If I compact the
database
> > doesn't that change next identity to the first available number? For
> > example
> > I range an Identity Range allocated from the server that is 505000 to
> > 506000. After compacting the next identity could be 504007 since I
didn't
> > use that entire range before and I would still get an error because the
> > identity is below the allocated range.
> >
> > Since this error occurs on the first insert to a table with an Identity
> > column, it sounds like I should compact the database after every
> > synchronization?
> >
> >
> > "Kevin Collins (MS - SQL Mobile)" <kevincol@online.microsoft.com> wrote
in
> > message news:e9L5o54tEHA.2808@TK2MSFTNGP14.phx.gbl...
> >> Does this happen just on this particular database or does it happen all
> > the
> >> time after doing subsequent syncs? Also have you tried compacting the
> >> database after you get this error to see if that might resolve the
> > problem.
> >>
> >> "John Kendrick" <jkendrick@DONTneoSPAMrr.com> wrote in message
> >> news:eO4wz1ttEHA.2624@TK2MSFTNGP11.phx.gbl...
> >> > I'm receiving this error from SSCE 2.0 when trying to insert a new
row.
> >> >
> >> > Error Code: 80004005
> >> > Message: The new value generated for the inserted row does not fall
> > within
> >> > the allowable range. [Generated value,,,,,]
> >> > Minor err: 25081
> >> > Source: Microsoft SQL Server 2000 Windows CE Edition
> >> > Num. Par.: 505000
> >> >
> >> > I checked the SQL Server Publication Properties -> Articles ->
> >> > Indentity
> >> > Range and noticed that the "Next range starting value" is 505000.
> > Whenever
> >> > I
> >> > synchronize the "Next range starting value" is increased by 1000 and
if
> > I
> >> > insert a new row into that table on the PPC, I get this error where
the
> >> > Num.
> >> > Par. matches the "Next range starting value". The only way I found to
> > get
> >> > around this error is to re-create the database or call
> >> > ReinitializeSubscription.
> >> >
> >> > Does anyone have any thoughts on why this is occuring.
> >> >
> >> > Some additional information:
> >> > The tables that the handheld will inserting value with Identity
columns
> >> > marked as NOT FOR REPLICATION. In the publication, the tables
Identity
> >> > Range
> >> > tab has the "Automatically assign and maintain a unique identity
> > range..."
> >> > checked.
> >> >
> >> > This is an eVB application that is being rewritten to run under the
> >> > .NET
> >> > platform. The eVB application continues to functions properly.
> >> >
> >> > When running the INSERT in the PPC Query Analyzer, I get the identity
> >> > error
> >> > that the .NET application produces.
> >> >
> >> > There is a difference in the method of insert between the eVB
> > application
> >> > and the .NET application. The eVB uses an ADOCE.Recordset while the
new
> >> > application is using straight SQL statements.
> >> >
> >> >
> >>
> >>
> >
> >
>
>



Relevant Pages

  • Re: Error 25081: Incorrectly generating identities after a merge
    ... every synchronization I do that doesn't use the ReinitializeSubscription. ... I have never attempted to compact the database. ... The eVB application continues to functions properly. ...
    (microsoft.public.sqlserver.ce)
  • Re: Error 25081: Incorrectly generating identities after a merge
    ... Compacting the database will not move the identity range up. ... So you are safe ... You should not need to compact the database after every synchronization. ...
    (microsoft.public.sqlserver.ce)
  • RE: Compacting MDB help
    ... The autoexec macro opens a ... The FrontEnd.mdb's main switchboard has a cbo to switch back end ... FECompact.mdb runs the few lines of code to compact the FrontEnd.mdb ... I'm quite certain that you can't Compact an open database from within itself ...
    (microsoft.public.access.modulesdaovba)
  • RE: Compacting MDB help
    ... This will cause the database to grow so Compacting ... not split off the tables from your FrontEnd. ... The FrontEnd.mdb's main switchboard has a cbo to switch back end ... FECompact.mdb runs the few lines of code to compact the FrontEnd.mdb ...
    (microsoft.public.access.modulesdaovba)
  • RE: Compacting MDB help
    ... not practical to have staffpersons open another database in order to switch ... When the front end opens, it goes directly to the main switchboard. ... the only reason why you would need to Compact the ...
    (microsoft.public.access.modulesdaovba)