pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Paul Thomas <paul@tmsl.demon.co.uk>
To: Carlos Barroso <miguel.barroso@mail.pt>
Cc: pgsql-jdbc @ postgresql . org <pgsql-jdbc@postgresql.org>
Subject: Re: Can't insert more than 80 registers!?
Date: Tue, 11 May 2004 12:40:44 +0100
Message-ID: <20040511124044.C25409@bacon> (raw)
In-Reply-To: <20040511103520.1ADC6D1B1EE@svr1.postgresql.org>
References: <20040511103520.1ADC6D1B1EE@svr1.postgresql.org>


On 11/05/2004 11:35 Carlos Barroso wrote:
> Here's the testing code:
> 
> Class.forName("org.postgresql.Driver");
> Connection conn =
> DriverManager.getConnection("jdbc:postgresql://localhost:6543/dbdev",
> "developer", "xpto");
> 			 
> Statement st = null;
> for(int i = 1; i <= 90; i++) {
> 	st = conn.createStatement();
> 	st.executeUpdate("INSERT INTO
> plano_ensaio(id,ensaio_fk,op_fk,data_hora,estado,user_id,dt_hr) VALUES ("
> + i +
> ",1,1,'2004-04-04 10:11:11','A','mike','2004-05-05 05:55:55')");
> }
> 
> st.close();
> conn.close();
> 
> Results:
> The code above doesn't give any error. The BIG problem is that it's only
> inserting 80 and NOT 90 registers!?
> I've tried everything I know and I can't get it working.
> I thought it could be because of some WAL configuration, so I increased
> the
> "wal_buffers" parameter, but got no success.
> 
> Can someone please help me? Don't know what to do.

I don't know what the exact problem is but you're got a resource leak. 
Your st.close() should really be inside your for() loop.

-- 
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for 
Business             |
| Computer Consultants         | 
http://www.thomas-micro-systems-ltd.co.uk   |
+------------------------------+---------------------------------------------+



view thread (4+ messages)  latest in thread

Message-ID: <20040511124044.C25409@bacon>
Permalink:  ../20040511124044.C25409@bacon/
Also on:    postgresql.org/message-id/20040511124044.C25409@bacon

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: paul@tmsl.demon.co.uk, miguel.barroso@mail.pt
  Subject: Re: Can't insert more than 80 registers!?
  In-Reply-To: <20040511124044.C25409@bacon>
  References: <20040511103520.1ADC6D1B1EE@svr1.postgresql.org> <20040511124044.C25409@bacon>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox