Dear,

I implemented this method to replace an other method I use normally which is to get the OID from the inserted row, and then query the primary key (autoincremented) from that row:

long oid = ((org.postgresql.PGStatement)statement).getLastOID();
Then a normal dB query select * from table where oid=oid.

I had my doubts on the concurrency with the code suggested by Bart, so implemented a checking of those two strategies. I activated this method on a producten track & trace which receives a lot of gps data and inserts this in a table. Running now for about 3 hours i already saw 3 occurences of both methods producing different values.

Haven't looked into detail why but it proves to me that the select after the insert do not occur within an atomic transaction in the database.

I implemented connection pooling however so this might have something to do with it.

Thomas