From: youjun g. <you...@ya...> - 2010-01-27 20:54:18
|
Every table in TB was created with a piece of script incuding a line like this: phylotreenode_id bigint NOT NULL DEFAULT nextval('hibernate_sequence'::regclass), My guess is this is not a hibernate issue, instead it's a business of postgresql. No matter through what application a insert to the table will always cause a query to the sequence. Think of this, if we change the name of "hibernate_sequence" to something else will it work the same way? will other application know the exist of hibernate? Youjun On Wed, Jan 27, 2010 at 2:42 PM, Hilmar Lapp <hl...@ne...> wrote: > So does this mean that Hibernate assumes that no-one else is touching the > database while it is running. > > Does this then also mean that we cannot touch the database (such as for > inserting data) through any other means than the running instance of > Hibernate while such an Hibernate is running? I.e., a Java program that also > uses Hibernate but runs as a separate process won't do either. Is this a > situation that we can live with, or does this need to be remedied? > > My gut feeling is the latter, but I'd like to hear people's thoughts. > > -hilmar > > > On Jan 27, 2010, at 1:46 PM, Vladimir Gapeyev wrote: > > > Here is what happened to user_id and person_id in an empty database after I > created a handful new users, starting with hibernate_sequence = 1000 (that's > ONE thousand) > > user_id username person_id hibernate_sequence > 10000 "vgapeyev"; 10010 1001 > 10001 "vgapeyev2"; 10011 1001 > 10002 "vgapeyev3"; 10012 1001 > 10020 "vgapeyev4"; 10030 1003 > > That is, Hibernate uses values from hibernate_sequence to generate PK ids > in some cleverly mysterious ways. > > Consequently, the current declarations of PK columns like > user_id bigint NOT NULL DEFAULT nextval('hibernate_sequence'::regclass); > > may deceive someone that an INSERT of a row without an ID explicitly > specified would be ok, since the DB appears to know how to do the right > thing. > > So, I'd propose to drop the default declarations, to avoid the deception: > > user_id bigint NOT NULL; > > --Vladimir > > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the > business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > > http://p.sf.net/sfu/theplanet-com_______________________________________________ > Treebase-devel mailing list > Tre...@li... > https://lists.sourceforge.net/lists/listinfo/treebase-devel > > > -- > =========================================================== > : Hilmar Lapp -:- Durham, NC -:- informatics.nescent.org : > =========================================================== > > > > > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the > business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > Treebase-devel mailing list > Tre...@li... > https://lists.sourceforge.net/lists/listinfo/treebase-devel > > |