title: Error preallocating sequence numbers. The sequence table information is not complete
body: <p>EclipseLink 2.6.3, JPA 2.0, IBM Websphere 8.5.5.8 and JTA enabled</p>
  
  <p>I'm currently facing this weird error suddenly and happening intermittently </p>
  
  <blockquote>
    <p>Exception [EclipseLink-4011] (Eclipse Persistence Services -
    2.6.3.v20160428-59c81c5): org.eclipse.persistence.exceptions.DatabaseException Exception
    Description: Error preallocating sequence numbers.  The sequence table
    information is not complete.</p>
  </blockquote>
  
  <p>My sequence generators in entities are like below </p>
  
  <pre><code>    @Id
      @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="AlrtSeq")
      @SequenceGenerator(name="AlrtSeq",sequenceName="ALR_SEQ1",allocationSize=1)
      @Column(name="ALERT_NO")
      private Integer Number;
  </code></pre>
  
  <p>I have debugged Eclipselink source code and it throws error at this method</p>
  
  <p><strong>StandardSequence.java</strong></p>
  
  <pre><code>public Vector getGeneratedVector(Accessor accessor, AbstractSession writeSession, String seqName, int size) {
      if (shouldUsePreallocation()) {
          Number value = updateAndSelectSequence(accessor, writeSession, seqName, size);
          if (value == null) {
              throw DatabaseException.errorPreallocatingSequenceNumbers();
          }
          return createVector(value, seqName, size);
      } else {
          return null;
      }
  }
  </code></pre>
  
  <p>How can be select seq.nextVal from dual can be null ? Because that's what internally happens in <strong>updateAndSelectSequence()</strong> method.</p>
  
  <p>I have also enabled <strong>((AbstractSession)session).setIsConcurrent(true);</strong> for improving performance, in my SessionCustomizer class.Does this property has to do something with this ?</p>
  
  <p><strong>Exception stack trace</strong></p>
  
  <pre><code>Caused by: Exception [EclipseLink-4011] (Eclipse Persistence Services - 2.6.3.v20160428-59c81c5): 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.Sequence.getGeneratedVector(Sequence.java:257)
      at org.eclipse.persistence.internal.sequencing.SequencingManager$Preallocation_NoTransaction_State.getNextValue(SequencingManager.java:683)
      at org.eclipse.persistence.internal.sequencing.SequencingManager.getNextValue(SequencingManager.java:1107)
      at org.eclipse.persistence.internal.sequencing.ClientSessionSequencing.getNextValue(ClientSessionSequencing.java:70)
      at org.eclipse.persistence.internal.descriptors.ObjectBuilder.assignSequenceNumber(ObjectBuilder.java:362)
      at org.eclipse.persistence.internal.descriptors.ObjectBuilder.assignSequenceNumber(ObjectBuilder.java:321)
      at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.assignSequenceNumber(UnitOfWorkImpl.java:486)
      at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNotRegisteredNewObjectForPersist(UnitOfWorkImpl.java:4288)
      at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.registerNotRegisteredNewObjectForPersist(RepeatableWriteUnitOfWork.java:521)
      at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.discoverAndPersistUnregisteredNewObjects(UnitOfWorkImpl.java:4187)
      at org.eclipse.persistence.mappings.CollectionMapping.cascadeDiscoverAndPersistUnregisteredNewObjects(CollectionMapping.java:483)
      at org.eclipse.persistence.internal.descriptors.ObjectBuilder.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectBuilder.java:2515)
      at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.discoverAndPersistUnregisteredNewObjects(UnitOfWorkImpl.java:4205)
      at org.eclipse.persistence.mappings.ObjectReferenceMapping.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectReferenceMapping.java:951)
      at org.eclipse.persistence.mappings.ObjectReferenceMapping.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectReferenceMapping.java:929)
      at org.eclipse.persistence.internal.descriptors.ObjectBuilder.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectBuilder.java:2515)
      at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.discoverAndPersistUnregisteredNewObjects(UnitOfWorkImpl.java:4205)
      at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.discoverUnregisteredNewObjects(RepeatableWriteUnitOfWork.java:308)
      at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.calculateChanges(UnitOfWorkImpl.java:723)
      at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1516)
      at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.issueSQLbeforeCompletion(UnitOfWorkImpl.java:3168)
      at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.issueSQLbeforeCompletion(RepeatableWriteUnitOfWork.java:355)
      at org.eclipse.persistence.transaction.AbstractSynchronizationListener.beforeCompletion(AbstractSynchronizationListener.java:158)
  </code></pre>