Hi!

I'm going to answer your question, but please read the below as well about
where to ask questions in future.

You can't stop ID's being consumed during a transaction - databases do this
by default to avoid any potential confusion between "versions" of objects
with the same ID. But if you absolutely need contiguous ID sequences, you
can use the package django-sequences (
https://github.com/aaugustin/django-sequences ) to achieve this. It reduces
concurrency though as it requires extra locking to do so.

...

I think you've found the wrong mailing list for this post. This mailing
list is for discussing the development of Django itself, not for support
using Django. This means the discussions of bugs and features in Django
itself, rather than in your code using it. People on this list are unlikely
to answer your support query with their limited time and energy.

For support, please follow the "Getting Help" page:
https://docs.djangoproject.com/en/stable/faq/help/ . This will help you
find people who are willing to support you, and to ask your question in a
way that makes it easy for them to answer.

Thanks for your understanding and all the best,

Adam



On Sun, Apr 24, 2022 at 3:27 PM Satyabrata Sbr <satyabrata...@gmail.com>
wrote:

> How can i stop auto increment of primary key field of a model when some
> exception occurs inside transaction.atomic()?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/6b555ca1-9ede-4193-8a50-206f9071cd3bn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-developers/6b555ca1-9ede-4193-8a50-206f9071cd3bn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM2JYjCi8JPFRTfYpz_Xs8B1gnRnbNGCufNoZS5Bmz18ig%40mail.gmail.com.
  • How... Satyabrata Sbr
    • ... 'Adam Johnson' via Django developers (Contributions to Django itself)

Reply via email to