lbehnke / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

pgserver insert duplicated data #53

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
just try to start a pgserver to act as a psuedo postgresql database and
access with PostgreSQL JDBC driver. In my simple INSERT, data are inserted
twice.

create table test( x varchar(255) );
insert into test values ( 'hello world 1' );
select count(*) from test; //return 2 

environment:
H2 1.1.107 (2009-01-24)
PostgreSQL JDBC postgresql-8.3-604.jdbc4.jar
JDK 6

Original issue reported on code.google.com by mingfai...@gmail.com on 1 Feb 2009 at 4:53

GoogleCodeExporter commented 9 years ago
btw, the pgserver is reported as PostgreSQL
8.1.4 . i wonder if it is mean it is compatiable with PostgreSQL 8.1.4 and I 
should
use pg jdbc 8.1.4 to test.

Original comment by mingfai...@gmail.com on 1 Feb 2009 at 5:12

GoogleCodeExporter commented 9 years ago
tested with 8.1-413 JDBC 3 and the result is the same. duplicated record are 
inserted

Original comment by mingfai...@gmail.com on 1 Feb 2009 at 5:15

GoogleCodeExporter commented 9 years ago
I can't reproduce it (it works for me). To be sure the table is empty, could 
you try:

create table test( x varchar(255) );
delete from test;
insert into test values ( 'hello world 1' );
select count(*) from test;

Original comment by thomas.t...@gmail.com on 1 Feb 2009 at 10:42

GoogleCodeExporter commented 9 years ago
i found that the problem with DbVisualizer on Windows.

The version i was using is 6.0.12, and it inserts double any data insert. And I 
just
tried with the latest 6.5.2, and the result is... it does triple insertion!!! 
lol

for normal PostgreSQL server, DbVisualizer will not behave like this. so i 
can't tell
if it is a problem with H2 pgserver or DbVisualizer

Original comment by mingfai...@gmail.com on 1 Feb 2009 at 11:13

GoogleCodeExporter commented 9 years ago
please read this issue as "support dbvisualizer for pgserver" 

Original comment by mingfai...@gmail.com on 1 Feb 2009 at 11:18

GoogleCodeExporter commented 9 years ago
Hi,

It sounds like a problem of DbVisualizer then. You should probably report it 
there.

Regards,
Thomas

Original comment by thomas.t...@gmail.com on 1 Feb 2009 at 12:11

GoogleCodeExporter commented 9 years ago
just submit a support request to DbVisualizer. Hope they'll follow up. 

Original comment by mingfai...@gmail.com on 1 Feb 2009 at 12:59

GoogleCodeExporter commented 9 years ago
I just tried DbVisualizer 6.5.3 with H2 using two different
JDBC driver. Both works as expected i.e. only one row is created.
Please see the attached screenshots.

You may enable debug of DbVisualizer as described in:

http://www.minq.se/products/dbvis/doc/faq/faq.jsp#4.14

Then re-execute the insert command. I am pretty sure you will
only see one INSERT being executed. 

Best Regards

Roger
DbVisualizer Team

Original comment by roger...@gmail.com on 1 Feb 2009 at 6:44

Attachments:

GoogleCodeExporter commented 9 years ago
i give up. if anyone care, you may try my procedure. the problem is repeatable 
on my
computer. The following is the my env info and procedure to repeat:

- JDK
java version "1.6.0_10"
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)

- H2 Start with 
java -jar h2-1.1.107.jar -pg  -pgPort 5432
(remarks: to ensure it is the instance i'm using, before running the command, 
'telnet
localhost 5432' has no response, and after running the command, there is)

- DbVisualizer
Product:  DbVisualizer Free 6.5.3
Build:  #1361 (2009/01/12 00:11)
Java VM:  Java HotSpot(TM) Client VM
Java Version:  1.6.0_11
Java Vendor:  Sun Microsystems Inc.
OS Name:  Windows 2003
OS Arch:  x86
OS Version:  5.2

- see the attached screenshot and corresponding log

Original comment by mingfai...@gmail.com on 1 Feb 2009 at 7:14

Attachments:

GoogleCodeExporter commented 9 years ago
if it's not clear, i use a new database name now. so i don't bother to run the 
delete
statement. and if the table is existed already (i.e. may contain data), the 
create
table step would have failed.

Original comment by mingfai...@gmail.com on 1 Feb 2009 at 7:15

GoogleCodeExporter commented 9 years ago
some files are missed from the prev message. pls check according to the 
sequence of
the file name

Original comment by mingfai...@gmail.com on 1 Feb 2009 at 7:16

Attachments: