tags:

views:

120

answers:

1

Hello!

Having a console app which which many will start over and over again and using hilo. Everytime the app is started and the sessionfactory is rebuilt the hilo columns (next_hi) will be increased and a reserved space with ids will be lost.

Have anybody had any experience with this?

Could't that be a nice feature for the hilo-generator to optionally remember the high and low-values for applications often being shutdown by many users? I mean it have already reserved a space of ids, which in that environment often isn't fully utilized.

Thank you for sharing your experiences in advance!

+6  A: 

Int64 max value is 9223372036854775807. Lets assume that each application start you will insert one record and lose 99 ids. it means you have 9223372036854775807 / 100 = 92233720368547758 effective ids.

Lets assume you applications inserts 50000 records per second into database.

92233720368547758 / 50000 = 184467440737095.51614 seconds = 2135039823.346012918287037037037 days = 5930666 years.

Are you still worried?

Alex Reitbort