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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:31:21+00:00 2026-05-25T21:31:21+00:00

I have a sequence object in my oracle db: create sequence BASE_SEQ minvalue 1

  • 0

I have a sequence object in my oracle db:

create sequence BASE_SEQ
minvalue 1
maxvalue 9999999999999999999999999999
start with 100
increment by 1
nocache;

I use jpa(toplink) for my web application. I have base class for all my db objects:

@MappedSuperclass
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)

public class AbstractEntity implements Serializable {
    protected BigDecimal id;

    @javax.persistence.Column(name = "ID")
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "BASE_SEQ")
    @SequenceGenerator(name="BASE_SEQ",sequenceName="BASE_SEQ", catalog = "DOF")
    public BigDecimal getId() {
        return id;
    }

This class is inherited by some entities. After I start my application, and persist/merge several entities to db, i can find, that theirs’ PK starts with 51 (instead of expected 100).

After that, I go to my db, view DDL of my sequence object and see, that it has been changed to:

create sequence BASE_SEQ
minvalue 1
maxvalue 9999999999999999999999999999
start with 101
increment by 1
nocache;

Why so happens? I have some entities with PK 51, 52 … etc, and sequence starting with 101.

AS – GlassFish 3.1.1

  • 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-25T21:31:22+00:00Added an answer on May 25, 2026 at 9:31 pm

    The default preallocationSize on SequenceGenerator is 50, it must match your sequence increment, which you have set to 1.

    Either change your increment to 50 (recommended), or change your preallocationSize to 1 (this will result in poor insert performance).

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

Sidebar

Related Questions

I have an object that is basically a Python implementation of an Oracle sequence.
If I have sequence of sequences (maybe a list of tuples) I can use
I have a sequence of SQL calls, which I want to use to detect
Does first object in sequence diagram have to have activation rectangle or is it
I have a sequence defined in my database that I want to use in
I have a string sequence that goes like this: <x:object*10/> . I want to
I have a problem where I need to keep and increment an object number
I have a sequence with images of an object from different angles. I want
I have a sequence of migrations in a rails app which includes the following
I have a sequence. a1 = 1 - cos(x); ai = a1 + (-1)^(i-1)

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.