Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v5.2
  HXTT Cobol v2.1
  HXTT DBF v5.2
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Excel v4.2
  HXTT Paradox v5.2
  HXTT Text(CSV) v5.2
  HXTT XML v1.2
Offshore Outsourcing
Oracle Data Import/Export
DB2 Data Import/Export
Sybase Data Import/Export
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
   
   
   
Hongxin Technology & Trade Ltd. of Xiangtan City (abbr, HXTT)

HXTT DBF
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 = ...
em.getTransaction().begin();
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(DatabaseException.java:150)
at org.eclipse.persistence.sequencing.StandardSequence.getGeneratedVector(StandardSequence.java:73)
at org.eclipse.persistence.sequencing.DefaultSequence.getGeneratedVector(DefaultSequence.java:163)
at org.eclipse.persistence.sequencing.Sequence.getGeneratedVector(Sequence.java:257)
at org.eclipse.persistence.internal.sequencing.SequencingManager$Preallocation_Transaction_NoAccessor_State.getNextValue(SequencingManager.java:468)
at org.eclipse.persistence.internal.sequencing.SequencingManager.getNextValue(SequencingManager.java:1067)
at org.eclipse.persistence.internal.sequencing.ClientSessionSequencing.getNextValue(ClientSessionSequencing.java:70)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.assignSequenceNumber(ObjectBuilder.java:359)
at org.eclipse.persistence.internal.descriptors.ObjectBuilder.assignSequenceNumber(ObjectBuilder.java:318)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.assignSequenceNumber(UnitOfWorkImpl.java:484)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNotRegisteredNewObjectForPersist(UnitOfWorkImpl.java:4284)
at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.registerNotRegisteredNewObjectForPersist(RepeatableWriteUnitOfWork.java:518)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:4229)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.persist(EntityManagerImpl.java:496)
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



org.eclipse.persistence.jpa.PersistenceProvider

...

...



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

CREATE SEQUENCE Emp_Seq
MINVALUE 1
START WITH 1
INCREMENT BY 1
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="eclipselink.platform.class.name" value="com.hxtt.support.eclipselink.DbfPlatform" / 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 eclipselink.target-database property to replace eclipselink.platform.class.name .

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




Google
 

Address: 9 Station Rd., Xiangtan City, Hunan Province, P.R. China
Postcode: 411100
Phone: (86)731-58225727
Fax: (86)731-58225727
Email: webmaster@hxtt.com
Copyright © 1999-2011 Hongxin Technology & Trade Ltd. | All Rights Reserved. | Privacy | Legal | Sitemap