Quote:
sequence is not in a continuous fashion
With strategy=GenerationType.IDENTITY you could have sequence in a continuous fashion,
if your database would support 'identity columns' like for example DB2, MySQL, MSSQL, Sybas, HSQLDB are doing.
Apparently your database does not and so hibernate uses a sequence or hilo for generating identifiers.
With this implementations it is normal that there will be gaps in the ID's sequence as you describe.
It is because each HibernateSessionFactory is allocating a entire ranges of numbers, in order to avoid to frequent accesses to the sequence.
But this number gaps are absolutely no problem, the number range is big enough and will not run out of numbers.