X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id B741CD1B3BF for ; Tue, 11 May 2004 09:47:44 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 92211-05 for ; Tue, 11 May 2004 09:47:26 -0300 (ADT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 2AAFCD1B3BE for ; Tue, 11 May 2004 09:47:22 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1BNWfJ-0007Lj-00; Wed, 12 May 2004 00:47:21 +1200 Message-ID: <40A0CB55.5060400@opencloud.com> Date: Wed, 12 May 2004 00:47:17 +1200 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Carlos Barroso Cc: pgsql-jdbc@postgresql.org Subject: Re: Can't insert more than 80 registers!? References: <20040511103520.1ADC6D1B1EE@svr1.postgresql.org> In-Reply-To: <20040511103520.1ADC6D1B1EE@svr1.postgresql.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.3 tagged_above=0.0 required=5.0 tests=PLING_QUERY, RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200405/50 X-Sequence-Number: 10060 Carlos Barroso wrote: > 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 just tested this schema & code against 7.4.2 and pg74.213.jdbc3.jar. It works as expected, inserting 90 rows. The only difference in schema was that I dropped the foreign key constraints as you didn't provide DDL or data for the referenced tables. Here's what I did: > oliver@flood:~$ sandbox-7.4.2/bin/psql -p 5742 test > [... startup banner ...] > test=> CREATE TABLE PLANO_ENSAIO ( > test(> id INT8 NOT NULL > test(> , ensaio_fk INT8 NOT NULL > test(> , op_fk INT8 NOT NULL > test(> , data_hora TIMESTAMP(10) NOT NULL > test(> , estado CHAR(1) NOT NULL > test(> , user_id CHAR(10) NOT NULL > test(> , dt_hr TIMESTAMP(10) NOT NULL > test(> , PRIMARY KEY (id) ); > WARNING: TIMESTAMP(10) precision reduced to maximum allowed, 6 > WARNING: TIMESTAMP(10) precision reduced to maximum allowed, 6 > NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "plano_ensaio_pkey" for table "plano_ensaio" > CREATE TABLE > test=> \q > > oliver@flood:~$ cat Test.java > import java.sql.*; > > public class Test { > public static void main(String[] args) throws Exception { > Class.forName("org.postgresql.Driver"); > Connection conn = > DriverManager.getConnection("jdbc:postgresql://localhost:5742/test", > "oliver", "oliver"); > > 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(); > } > } > > oliver@flood:~$ javac -classpath pg74.213.jdbc3.jar Test.java > oliver@flood:~$ java -classpath pg74.213.jdbc3.jar:. Test > oliver@flood:~$ sandbox-7.4.2/bin/psql -p 5742 test > [... startup banner ...] > test=> select count(*) from plano_ensaio; > count > ------- > 90 > (1 row) > Can you provide something similar showing exactly what you're doing? Obviously there's something different between our setups. I'd also check the server logs for any errors; perhaps something is masking a failure to insert. Finally, if you do the same inserts by hand via psql, what happens? -O