From: Vladimir G. <vla...@du...> - 2009-12-26 15:03:58
|
On Dec 25, 2009, at 11:11 AM, youjun guo wrote: > method 1. use one single sequence for all the domain table; > method 2. assigned each domain table a induvadule sequnce. I would be in favor of using per-table postgresql sequences to generate IDs. I just think that, whatever solution we are inclined for, we should first make a good effort to understand what is going on. E.g., - As Bill alludes, different tables/objects might have been set up to use different methods of sequence generation. Then, our fix might have to be different for each method. - Is it possible that the single hibernate_sequence for all stored objects was used to ensure that there is a unique identifier for each stored object? Is there code that may depend on this? (e.g., some kind of audit?) > Also, for method 2, from now on, all these 70 sequence need to > maintain the synchronizing with data insert and data migration of > their table. I found some of them already lose the synchronise . I would guess the loss of id synch has happened for those tables xxx whose xxx_id_sequence value after TB1 import was below the hibernate_sequence value. The remaining tables (as you encountered for taxonlabel and phylotreenode) just refused to insert new rows (since ids generated for them by hibernate_sequence were clashing with existing rows). --Vladimir |