Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » update allocationSize of Sequence table
update allocationSize of Sequence table [message #756875] Tue, 15 November 2011 12:20 Go to next message
Vera Paskaleva is currently offline Vera PaskalevaFriend
Messages: 2
Registered: November 2011
Junior Member
Hello,

We're using a primary key generator of type TABLE. By now we used the default value of allocationSize 50. But we have some problems with concurrency and we want to update allocationSize to 1. We've tried doing this:
@Id
@TableGenerator(name = "ID_GENERATOR", table = "SEQUENCES", allocationSize=1)
@GeneratedValue(generator="ID_GENERATOR")
but the generator starts with id = 1 and we have already record in the database with id 1. Is there any way we can update allocationSize to primary key generator that exists already without the initial value to be 0?

Thank you.
Re: update allocationSize of Sequence table [message #756919 is a reply to message #756875] Tue, 15 November 2011 14:32 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
Hello,

The SequenceGenerator annotation allows setting the initialValue which is used when the generator is created. If you already have the sequence table setup, you can change the value in the database directly, or you can modify the table using a native SQL query in the application.

Best Regards,
Chris
Previous Topic:update allocationSize of Sequence table
Next Topic:IllegalArgumentException: eclipselink.profiler
Goto Forum:
  


Current Time: Wed Apr 24 17:53:28 GMT 2024

Powered by FUDForum. Page generated in 0.03179 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top