Hi Lester,

ID is generated using normal FB method. Only recently, I have started facing
this issue frequently on 'trntable' in larger databases where records are
excess of 10 million or so in 'trntable'. 

I think generator is getting reset due to some other external factors. If it
would have been an FB issue then it would have been replicated on somewhere
else also.
 

-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] 
Sent: 02 April 2018 06:12 PM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Auto-increment generating old ID's for
insertion

On 02/04/18 13:11, 'Joje' j...@codework-solutions.com [firebird-support]
wrote:
> I have issue where auto-increment of ID column is generating older 
> ID’s that is already used in table.
> 
> Currently, my transaction table has around 16 million rows and *ID of 
> last inserted row is 16,594,027*.  While the *generator ID its 
> 16,593,965*.  As you can see the generator is generating ID’s that is 
> already present in table which causes *violation of PRIMARY or UNIQUE 
> KEY constraint "INTEG_105"*error on that table.
> 
> I managed to fix this issue, recently I am facing it frequently on 
> this transaction table, majority of the tables had number of records 
> are more than 2 million or there is connectivity issues with DB.
> 
> Now, I am wondering is this related to Firebird DB or is there any 
> other issue.

Assuming that the ID is generated via the normal Firebird method, then there
is a generator linked with the auto-increment. If the generator has been
reset for some reason this would explain the current problem. 
Simply setting the generator above the current highest value will fix this.
However we do need to check out just how the new value is generated as well..

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk


------------------------------------

------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu
there.

Also search the knowledgebases at
http://www.ibphoenix.com/resources/documents/ 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------

Yahoo Groups Links




  • [firebird-support... 'Joje' j...@codework-solutions.com [firebird-support]
    • Re: [firebir... Lester Caine les...@lsces.co.uk [firebird-support]
      • RE: [fir... 'Joje' j...@codework-solutions.com [firebird-support]
    • Re: [firebir... Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
      • RE: [fir... 'Joje' j...@codework-solutions.com [firebird-support]
        • Re: ... Lester Caine les...@lsces.co.uk [firebird-support]
        • Re: ... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]

Reply via email to