From: | Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk> |
---|---|
To: | Carlos Barroso <miguel(dot)barroso(at)mail(dot)pt> |
Cc: | "pgsql-jdbc (at) postgresql (dot) org" <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Re: Can't insert more than 80 registers!? |
Date: | 2004-05-11 11:40:44 |
Message-ID: | 20040511124044.C25409@bacon |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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 |
+------------------------------+---------------------------------------------+
From | Date | Subject | |
---|---|---|---|
Next Message | Oliver Jowett | 2004-05-11 12:47:17 | Re: Can't insert more than 80 registers!? |
Previous Message | Carlos Barroso | 2004-05-11 10:35:21 | Can't insert more than 80 registers!? |