servoy seq needs to be different

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

Hi Bevil,

what about using the button on the “database servers” tab in servoy-admin?

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

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…

:shock:

Harjo:
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:
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?

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

Never seen or experience this behaviour with Servoy sequences…

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

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!) ?

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…

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

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…

:(

Thank you for your patience… :)

:lol: :lol:

bevil:
Thank you for your patience… :)

:D Now I can sleep in peace tonight…

Regards,