Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access 7.1.188
  HXTT Cobol 5.0.188
  HXTT DBF 7.1.189
  Buy Now
  HXTT Excel 6.1.192
  HXTT Json 1.0.160
  HXTT Paradox 7.1.188
  HXTT PDF 2.0.188
  HXTT Text(CSV) 7.1.188
  HXTT Word 1.1.188
  HXTT XML 4.0.189
Offshore Outsourcing
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)

Error preallocating sequence numbers
Edgar Hilton
2013-09-24 09:07:13.0
While attempting to fix code given to me by my customer, I created a simple test project that has three tables, I had my program create the tables (JPA 2.1 in NetBeans 7.3.1) in my persistence.xml file.

I have one table (ActivityLog) with an Id of type Long which has been annotated with "@GeneratedValue(strategy = GenerationType.AUTO)".

So, if I type:

EntityManager em = ...
ActivityLog l = new ActivityLog();
l.setTimeStamp(new Date());
em.persist(l); <----------------- fails here

What am I missing? Here is the exception:

Exception [EclipseLink-4011] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.DatabaseException
Exception Description: Error preallocating sequence numbers. The sequence table information is not complete.
at org.eclipse.persistence.exceptions.DatabaseException.errorPreallocatingSequenceNumbers(
at org.eclipse.persistence.sequencing.StandardSequence.getGeneratedVector(
at org.eclipse.persistence.sequencing.DefaultSequence.getGeneratedVector(
at org.eclipse.persistence.sequencing.Sequence.getGeneratedVector(
at org.eclipse.persistence.internal.sequencing.SequencingManager$Preallocation_Transaction_NoAccessor_State.getNextValue(
at org.eclipse.persistence.internal.sequencing.SequencingManager.getNextValue(
at org.eclipse.persistence.internal.sequencing.ClientSessionSequencing.getNextValue(
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.assignSequenceNumber(
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.assignSequenceNumber(
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.assignSequenceNumber(
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNotRegisteredNewObjectForPersist(
at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.registerNotRegisteredNewObjectForPersist(
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.persist(
Re:Error preallocating sequence numbers
HXTT Support
2013-09-24 17:25:57.0
Please enable automatic schema generation or create table for storing ID manually when using Table, Sequence or IDENTITY ID Generation.

opt#1. Enable automatic schema generation




opt#2. Create table for storing ID manually

Define Sequence in your entity

@SequenceGenerator(name="Emp_Gen", sequenceName="Emp_Seq")
@Id @GeneratedValue(generator="Emp_Gen")
private int getId;

SQL script to create sequence

Re:Re:Error preallocating sequence numbers
Edgar Hilton
2013-09-24 17:36:16.0
Option 1 does not work. I have

set in my persistence.xml file.

I still get the same exception. Trying option 2.
Re:Re:Error preallocating sequence numbers
Edgar Hilton
2013-09-24 17:37:45.0
I can now inform you that Option 2 did not work either. Same exception.
Re:Re:Re:Error preallocating sequence numbers
Edgar Hilton
2013-09-24 17:38:50.0
Oops, my XML entry for Option 1 did not show up in my previous message. The actual element looks like this in my persistence.xml file:

property name="eclipselink.ddl-generation" value="drop-and-create-tables"

Re:Re:Re:Re:Re:Error preallocating sequence numbers
HXTT Support
2013-09-24 19:53:22.0
Checked. Sorry. The pasted solution is wrong.
In fact, you need to download HXTT Glassfish Support Package, and add
lt;property name="" value="" / gt;
in your persistence.xml , then your issue will disappear.
Re:Re:Re:Re:Re:Re:Error preallocating sequence numbers
HXTT Support
2013-09-24 20:34:58.0
For the latest persistence.xml version, you can use property to replace .

Passed test for the following parameters with the latest package:
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@GeneratedValue(strategy = GenerationType.TABLE)

Search Key   Search by Last 50 Questions


Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Sitemap