Re: [SQL] Hibernate, web application and only one sequence for all primary keys

2009-09-19 Thread Lew
rawi wrote: Grails/Hibernate wishes per default one sequence for all tables-PKs and all PKs as BigInt. How is that a Hibernate default? Hibernate lets you define a multitude of types as a primary key, and the sequence each uses is a matter of XML or annotation configuration, at least in the

Re: [SQL] Hibernate, web application and only one sequence for all primary keys

2009-09-19 Thread Kenneth Marshall
On Thu, Sep 17, 2009 at 07:47:13AM -0700, rawi wrote: > > > Leo Mannhart wrote: > > > > Caveat: If you use the standard sequence generator in hibernate, it is > > not using the postgres-sequence in the "usual" manner. hibernate itself > > caches 50 ID's as sequence numbers by default. This means

Re: [SQL] Hibernate, web application and only one sequence for all primary keys

2009-09-17 Thread Craig Ringer
Tom Lane wrote: > rawi writes: >> Grails/Hibernate wishes per default one sequence for all tables-PKs and all >> PKs as BigInt. > > Redesign that software; this is fundamentally broken and stupid. It's a pretty silly default, but it's clearly intended for simple / small databases. In any real da

Re: [SQL] Hibernate, web application and only one sequence for all primary keys

2009-09-17 Thread Leo Mannhart
rawi wrote: > > Leo Mannhart wrote: >> Caveat: If you use the standard sequence generator in hibernate, it is >> not using the postgres-sequence in the "usual" manner. hibernate itself >> caches 50 ID's as sequence numbers by default. This means, hibernate >> only does a select on the database seq

Re: [SQL] Hibernate, web application and only one sequence for all primary keys

2009-09-17 Thread Rob Sargent
Above all, do not fret about whether or not it is "cool to lose" some ids. There are plenty of integers; the ids need not be consecutive. I don't think Grails requires a single sequence source and I know hibernate does not. Hibernate will allow one to inject any sequence/id generator you wis

Re: [SQL] Hibernate, web application and only one sequence for all primary keys

2009-09-17 Thread rawi
Tom Lane-2 wrote: > >> Grails/Hibernate wishes per default one sequence for all tables-PKs and >> all >> PKs as BigInt. > > Redesign that software; this is fundamentally broken and stupid. > Hi Tom, its me again... I only need to further understand... What for a source did have the OIDs in

Re: [SQL] Hibernate, web application and only one sequence for all primary keys

2009-09-17 Thread rawi
Leo Mannhart wrote: > > Caveat: If you use the standard sequence generator in hibernate, it is > not using the postgres-sequence in the "usual" manner. hibernate itself > caches 50 ID's as sequence numbers by default. This means, hibernate > only does a select on the database sequence every 50 n

Re: [SQL] Hibernate, web application and only one sequence for all primary keys

2009-09-17 Thread rawi
Tom Lane-2 wrote: > >> Grails/Hibernate wishes per default one sequence for all tables-PKs and >> all >> PKs as BigInt. > > Redesign that software; this is fundamentally broken and stupid. > Thank you Tom... but redesigning Grails and Hibernate is far beyond my possibilities :) I could work

Re: [SQL] Hibernate, web application and only one sequence for all primary keys

2009-09-17 Thread Tom Lane
rawi writes: > Grails/Hibernate wishes per default one sequence for all tables-PKs and all > PKs as BigInt. Redesign that software; this is fundamentally broken and stupid. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes t

Re: [SQL] Hibernate, web application and only one sequence for all primary keys

2009-09-17 Thread Leo Mannhart
rawi wrote: > Hello! > > The subject says it... > > Grails/Hibernate wishes per default one sequence for all tables-PKs and all > PKs as BigInt. > > What would you think about a database with some tens of tables and > incidentally low to moderate insert concurrency spread in about the half of >

Re: [SQL] Hibernate, web application and only one sequence for all primary keys

2009-09-17 Thread rawi
SORRY for incorrectly posting this here! I couldn't move it to PostgreSQL - performance... afterwards. While I don't want to double-post: It would be perfect, if the mail list admin - please - could correct my mistake... Regards, Rawi -- View this message in context: http://www.nabble.com/Hib

[SQL] Hibernate, web application and only one sequence for all primary keys

2009-09-17 Thread rawi
Hello! The subject says it... Grails/Hibernate wishes per default one sequence for all tables-PKs and all PKs as BigInt. What would you think about a database with some tens of tables and incidentally low to moderate insert concurrency spread in about the half of the tables from at most 10 conc