Re: psql and jdbc insert discrepencies

From: Barry Lind <blind(at)xythos(dot)com>
To: Clyde Wright <clyde-wright(at)utulsa(dot)edu>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: psql and jdbc insert discrepencies
Date: 2003-07-24 02:18:15
Message-ID: 3F1F41E7.6060007@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-novice

Clyde,

Are you commiting the insert in your jdbc code? If you do an insert
then a select in the same transaction the select will see the row, but
no other transactions will. If you then fail to commit the transaction
it will automatically rollback and thus the row will never be seen.

--Barry

Clyde Wright wrote:
> I've newly installed Postgres 7.3.3 on Redhat 6.0 and have a Java class
> that inserts rows into a table NAME with attributes ID (serial) and
> VALUE (text).
>
> After running the program once and inserting a name, I get no errors. I
> then SELECT * FROM NAME; via JDBC and it returns the 1 row that has been
> inserted. However, when I do a SELECT * FROM NAME; from psql in Linux,
> 0 rows are returned. When I do an insert from psql, the auto-id is 2
> (as it should be) but still, upon querying the database via psql, only
> the second row inserted is returned.
>
> What I am missing here?
>
> Cheers,
> Clyde
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Clyde Wright 2003-07-24 02:18:36 psql and jdbc insert discrepencies
Previous Message Oliver Jowett 2003-07-24 01:23:23 Re: New builds posted to jdbc.postgresql.org websit for jdbc driver

Browse pgsql-novice by date

  From Date Subject
Next Message Clyde Wright 2003-07-24 02:18:36 psql and jdbc insert discrepencies
Previous Message Josh Berkus 2003-07-23 18:28:07 Re: design/copying a bunch of records