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 8428441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:03:38+00:00 2026-06-10T05:03:38+00:00

I need for a particular business scenario to set a field on an entity

  • 0

I need for a particular business scenario to set a field on an entity (not the PK) a number from a sequence (the sequence has to be a number between min and max

I defined the sequence like this :

CREATE SEQUENCE MySequence
  MINVALUE 65536 
  MAXVALUE 4294967296 
  START WITH 65536
  INCREMENT BY 1
  CYCLE
  NOCACHE
  ORDER;

In Java code I retrieve the number from the sequence like this :

select mySequence.nextval from dual

My question is :

If I call this “select mySequence.nextval from dual” in a transaction and in the same time in another transaction same method is called (parallel requests) it is sure that the values returned by the sequence are different ?

Is not possible to have like read the uncommitted value from the first transaction ?

Cause let’s say I would have not used sequence and a plain table where I would increment myself the sequence, then the transaction 2 would have been able to read same value if the trasactinalitY was the default “READ COMMITTED”.

  • 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-06-10T05:03:40+00:00Added an answer on June 10, 2026 at 5:03 am

    The answer is NO.

    Oracle guarantees that numbers generated by sequence are different. Even if parallel requests are issued, RAC environment or rollback and commits are mixed.

    Sequences have nothing to do with transactions.

    See here the docs:

    Use the CREATE SEQUENCE statement to create a sequence, which is a
    database object from which multiple users may generate unique
    integers. You can use sequences to automatically generate primary key
    values.

    When a sequence number is generated, the sequence is incremented,
    independent of the transaction committing or rolling back. If two
    users concurrently increment the same sequence, then the sequence
    numbers each user acquires may have gaps, because sequence numbers are
    being generated by the other user. One user can never acquire the
    sequence number generated by another user. After a sequence value is
    generated by one user, that user can continue to access that value
    regardless of whether the sequence is incremented by another user.

    Sequence numbers are generated independently of tables, so the same
    sequence can be used for one or for multiple tables. It is possible
    that individual sequence numbers will appear to be skipped, because
    they were generated and used in a transaction that ultimately rolled
    back. Additionally, a single user may not realize that other users are
    drawing from the same sequence.

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

Sidebar

Related Questions

I need to get all the appointments from my table for a particular patient,
I have written a WPF Line of Business application that has a particular sections
I have some particular need to clone an element (image) and be draggable inside
I need to compare particular content of 2 SQL tables located in different servers:
I am trying to get started in testing ActiveAdmin, in particular I need to
i want tool for to generate DB diagram below, i need to generate particular
I need to do btnRate_Click after particular time on javascript/jquery protected void btnRate_Click(object sender,
I need to understand the working of this particular program, It seems to be
I need my client to bind to a particular port and then connect to
The problem: I need to ensure that a particular directory hierarchy exists in the

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.