On 25 Jun 2003 at 11:47, Michael Mattox wrote:
> I'm using Java Data Objects (JDO) which is an O/R mapper.  It generated the
> schema from my object model by default it used a table for a sequence.  I
> just got finished configuring it to use a real postgres sequence.  With the
> way they have it designed, it opens and closes a connection each time it
> retrieves a sequence.  Would I get a performance increase if I modify their
> code to retrieve multiple sequence numbers in one connection?  For example I
> could have it grab 50 at a time, which would replace 50 connections with 1.

You need to use sequence functions like setval, curval, nextval. May be you can 
write your own wrapper function to "grab" as many sequence values as you want 
but it would be good if you design/maintain locking around it as appropriate.





Velilind's Laws of Experimentation:     (1) If reproducibility may be a problem, 
conduct the test only once.     (2) If a straight line fit is required, obtain only 
two data points.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to