Re: Can't insert more than 80 registers!? - Mailing list pgsql-jdbc

From Paul Thomas
Subject Re: Can't insert more than 80 registers!?
Date
Msg-id 20040511124044.C25409@bacon
Whole thread Raw
In response to Can't insert more than 80 registers!?  (Carlos Barroso <miguel.barroso@mail.pt>)
List pgsql-jdbc
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   |
+------------------------------+---------------------------------------------+

pgsql-jdbc by date:

Previous
From: Carlos Barroso
Date:
Subject: Can't insert more than 80 registers!?
Next
From: Oliver Jowett
Date:
Subject: Re: Can't insert more than 80 registers!?