servoy seq needs to be different

Questions and answers regarding general SQL and backend databases

servoy seq needs to be different

Postby bevil » Thu Jan 08, 2015 8:10 pm

Hi all

I have migrated a Servoy 4 solution to Servoy 7, Sybase to Postgres, and everything is more or less okay.

I do have one problem though which is that I have a pk on one table which, when in Sybase was started at 16000, and has now grown to 18000+.

In Postgres I have to make it continue from the next id (18124), but it is continuing from the next max id (2k something).

The PK is a servoy sequence, not a db sequence, so I cannot use pgadmin to do a

ALTER SEQUENCE my_pk_id RESTART WITH 18124


Servoy developer no longer has the ability to set the start point of a sequence (which was how I set it to 16000 in the first place)

Anybody got the answer that I am looking for?

Thanks.

Bevil
bevil
 
Posts: 163
Joined: Thu Oct 18, 2012 7:31 pm

Re: servoy seq needs to be different

Postby swingman » Thu Jan 08, 2015 8:59 pm

Hi Bevil,

what about using the button on the "database servers" tab in servoy-admin?
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1472
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: servoy seq needs to be different

Postby Harjo » Fri Jan 09, 2015 12:36 am

Developer does not use the servoy sequence in the repository I believe. It takes automaticly the higest possible pk. A real servoy server you can reset indeed by using the reset servoy sequence button on the servoy admin page
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: servoy seq needs to be different

Postby bevil » Fri Jan 09, 2015 1:46 am

Thanks Harjo and Christian.

I know that I am able to sync the sequence, but that isn't going to help.. I have 2000 rows in my table, and the pk starts at 16000 and ends at 18123 or something. If I sync my sequence, it will just sync with the maxrow 2000something, not the max value, which is 18123...
bevil
 
Posts: 163
Joined: Thu Oct 18, 2012 7:31 pm

Re: servoy seq needs to be different

Postby lwjwillemsen » Fri Jan 09, 2015 9:34 am

:shock:
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: servoy seq needs to be different

Postby mboegem » Fri Jan 09, 2015 9:36 am

Harjo wrote:Developer does not use the servoy sequence in the repository I believe. It takes automaticly the higest possible pk. A real servoy server you can reset indeed by using the reset servoy sequence button on the servoy admin page

That is how it should be.
On application server I know this is working correct, I have my doubts on correct working in developer...

bevil wrote:If I sync my sequence, it will just sync with the maxrow 2000something, not the max value, which is 18123...

I've experienced similar things in developer, although I didn't have time to dig into the exact behaviour.

Maybe someone of Servoy can lookup in code what is happening in developer?
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1750
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: servoy seq needs to be different

Postby bevil » Fri Jan 09, 2015 9:45 am

Hey Marc

Thank you for the reply..

I have tested in both developer and server, and they both produce the same result. The next pk is 2005 or something, and I cannot override and say it needs to be 18124 anywhere that I can find...

:(

Hope you are well and that you had a great Xmas and New Year..

:)

Bevil
bevil
 
Posts: 163
Joined: Thu Oct 18, 2012 7:31 pm

Re: servoy seq needs to be different

Postby Harjo » Fri Jan 09, 2015 10:31 am

Never seen or experience this behaviour with Servoy sequences....
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: servoy seq needs to be different

Postby bevil » Fri Jan 09, 2015 10:46 am

Hey Harjo

I think it is behaving exactly as it is supposed to.. It finds the max pk, and increments it..

The problem is that in the old days, with Sybase, in Developer, you could specify your start point for a sequence, and upload that solution to your server, which would then start the sequence at that number.

I did this because a client wanted a particular number to start at 16000 for legacy reasons.

The problem is that now, when Servoy correctly calculates that there are 2103 rows in the table, increments the pk to 2104. This is out of sync with my number which should be 18124.

I can tell Servoy (developer or server) to sync the sequences, but it then - also correctly - syncs to 2103..

I think I will solve the problem in the dirtiest way possible, by adding 15999 dummy records to the table, and then tablefilterparam them out on start...

I could also unbind my pk from the number I need to use, but I have tried to do that and there is a lot of dependency on it (I know.. crappy programming, I should have used an unbound id to begin with, but I built this 5 years ago and didn't think about it.)

:)

Bevil
bevil
 
Posts: 163
Joined: Thu Oct 18, 2012 7:31 pm

Re: servoy seq needs to be different

Postby Harjo » Fri Jan 09, 2015 10:54 am

No, this is NOT how it should work.

if the max PK is 21008, after a reset, the next should be 21009!! despite the count of records in the database!!
Did you try to reset the sequence on a REAL application_server (with a repository and not started by developer!) ?
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: servoy seq needs to be different

Postby bevil » Fri Jan 09, 2015 11:00 am

Yes, I have run it on a test server. My next id is 2103. It is the same in developer and server...

I will try it again though...
bevil
 
Posts: 163
Joined: Thu Oct 18, 2012 7:31 pm

Re: servoy seq needs to be different

Postby Harjo » Fri Jan 09, 2015 11:05 am

Sorry, don't believe it.... :shock: :wink:

I have done this SO many times, there must be something different (or conflict) in your situation/setup
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Re: servoy seq needs to be different

Postby bevil » Fri Jan 09, 2015 11:08 am

Sigh... Of course you are right...

I have just tried it again, and yes, it does increment to the right number...

I have been fighting a completely imaginary dragon....

Sorry Harjo, I should have listened in the first place. I did test it, specifically, but must have done something wrong...

:(
bevil
 
Posts: 163
Joined: Thu Oct 18, 2012 7:31 pm

Re: servoy seq needs to be different

Postby bevil » Fri Jan 09, 2015 11:09 am

Thank you for your patience.. :)
bevil
 
Posts: 163
Joined: Thu Oct 18, 2012 7:31 pm

Re: servoy seq needs to be different

Postby Harjo » Fri Jan 09, 2015 11:18 am

:lol: :lol:
bevil wrote:Thank you for your patience.. :)
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Next

Return to SQL Databases

Who is online

Users browsing this forum: No registered users and 6 guests