File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MySQL + Eclipselink - SEQUENCE table

 
Santiago Bravo
Ranch Hand
Posts: 226
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Im using MySQL with Eclipselink for an application im writing. I have a question about the SEQUENCE tabe. Why does it increment the SEQ_GEN value by 50 every time i insert a row into the DB?

For example, i insert a row into the table from my application and its assigned an id of 1. Then the nextime i insert a new row it gets the value of 51.

Is there any way to control this so that its not jumping by 50 everytime?

Thanks

S.
 
Deepak Pant
Ranch Hand
Posts: 446
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please check the value of AUTO_INCREMENT defined in the MySQL table definition. I think the value of AUTO_INCREMENT is 50 in your case. This will cause the auto increment by 50 every time you request primary key generation.
 
Santiago Bravo
Ranch Hand
Posts: 226
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepak Pant wrote:Please check the value of AUTO_INCREMENT defined in the MySQL table definition. I think the value of AUTO_INCREMENT is 50 in your case. This will cause the auto increment by 50 every time you request primary key generation.



Thanks for your reply Deepak. I had to create a sequence table manually using the following code:




In the table that i am inserting rows, i already had the primary key with the AUTO_INCREMENT definition.

How can i change the count to increment by 1 rather than add another 50 to the count?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic