title: Sequence's current value advances to next 100 upon reconnection in derby
body: <p>I am having an issue with derby sequences with embedded database. When I first connect to the data base it gives me the correct sequence next value with the following statement.</p>
  
  <pre><code>VALUES (NEXT VALUE FOR :seqNm)
  </code></pre>
  
  <p>But when restart my desktop application, there by reconnecting to the database, the next value gives me the next hundredth value. It seems like derby uses some caching for preallocating the sequence numbers.</p>
  
  <p>e.g. if my sequence starts with 100,
  First connection to the data base gives me sequences as 100, 101, 102 and so on.</p>
  
  <p>Second connection to the data base gives me sequences as 200, 201, 202, 203 and so on.</p>
  
  <p>Third connection to the data base gives me sequences as 300, 301, 302, 303 and so on.</p>
  
  <p>Is there any workaround for this issue? I am using spring to connect to the database.</p>
  
  <p>Thanks!!</p>