Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3789944
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:14:14+00:00 2026-05-19T12:14:14+00:00

I have a table with bills. Every bill has an id that comes from

  • 0

I have a table with bills. Every bill has an id that comes from the DB after I insert a new record. The field is an INTEGER with AUTO_INCREMENT set.

If I insert a new record as part of a transaction and I have to rollback this transaction, the ID is taken and gone. So the next record becomes the ID one higher, even though this ID is not in use.

It would be better for the bills to have a linear numbering, so the accounting can figure out if something is wrong.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T12:14:15+00:00Added an answer on May 19, 2026 at 12:14 pm

    For concurrency reasons, the auto increment value cannot “rollback” with your transaction. If another process had inserted records while your transaction was in process, you’d risk a collision with their IDs later.

    As an example, let’s say your transaction in process “A” grabs IDs 1,2 and 3. Another process “B” runs and gets IDs 4 and 5. If the identity rolled back with your transaction and the next process “C” needed 5 IDs, it would get 1,2,3,4,5 but 4 and 5 were already taken by process “B”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables.. Client Bills - Contains bill infor for clients from billRecievedFromClient
I have a table that contains records that can become part of a bill.
I have the following that is generate for every record in my database $allbills
I have the following table: 'committee' table commname profname ======================== commA bill commA jack
I have table inside a div tab. The table has 40 rows in it
I have table rows of data in html being filled from a CGI application.
I have table with some fields that the value will be 1 0. This
The table's schema is pretty simple. I have a child table that stores a
I have a Bill table like this BillNo - 1, ServiceCode -1, ServiceName -
I have an HTML table of tickets listings (e.g. http://seatgeek.com/event/show/23634/buffalo-bills-vs-tennessee-titans/ ). I'd like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.