Re: My problems with PostgreSQL

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема Re: My problems with PostgreSQL
Дата
Msg-id 00ce01c1b3d4$126ebb50$8201a8c0@inspiron
обсуждение исходный текст
Ответ на My problems with PostgreSQL  (Pavel Tavoda <tavoda@thr.sk>)
Список pgsql-jdbc
Pavel,

I will try to answer what I can, hopefully some more experience people
can chime in with their opinions

1) If the result set is empty you should find out when you do a
ResultSet.next() I'm not sure how you are getting the Exception
2) There is a numeric data type which is bigger. How big do you want it,
int8 is pretty big!
3) Once a transaction has gone astray it needs to be rolled back, or
ended, you cannot continue to do inserts on it. This only makes sense
from my POV. The idea is that a transaction should be atomic, and if
anything interrupts the transaction it should be dealt with.

Dave

-----Original Message-----
From: pgsql-jdbc-owner@postgresql.org
[mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Pavel Tavoda
Sent: Tuesday, February 12, 2002 9:25 AM
To: pgsql-jdbc@postgresql.org
Subject: [JDBC] My problems with PostgreSQL


Hello everybody,
I'm new in this list and at beging I want thanks to all
members of postgresql community for stuff you made.
Pretty amazing piece of work. After playing around
with postgresql I found that's right time to thing about
using it for real project. When I was trying switch our
JDBC based project from Oracle (SQL92 compliant code
- no Oracle extensions) to PostgreSQL I found following
obstacles:
1. SQLException is fired back when query result set is empty. Is this
right behaviour ???

2. Datatypes
NUMBER isn't supported
Is't here bigger int type than int8 ???

3. "*ABORT STATE*" problem.
I started our server engine against PostgresSQL. From
generated logs it's was looking good but then I found
BIIIIG problem. I'm doing following scenario (it's
pseudocode not real code), I hope it's self explaining:

insertStatement='insert into aa ....';
try {
    dbConn.executeUpdate(insertStatement);
} catch (SQLException e1) {
    try {
        log.info("Some error when inserting into table -> trying create
table");
        dbConn.executeUpdate('create table aa ....');

        log.info("Reexecute insert statement");
        dbConn.executeUpdate(insertStatement);

    } catch(SQLException e2) {
        log.error("Some real DB error (wrong schema ?!?)");
    }
}

Then simillar scenario via 'psql' tool:
test=# begin;
BEGIN
test=# insert into aa values (23);
ERROR:  Relation "aa" does not exist
test=# create table aa (aa int8);
NOTICE:  current transaction is aborted, queries ignored until end of
transaction block
*ABORT STATE*

HUH, what is ABORT STATE - I can't make wrong statement ???!!!!??? Why
it's necessary abort whole transaction ???!!!???

I'm very experienced Java programmer and experienced C/C++ programmer
(or I was 3 years ago but you can't forget bicycling ;-) now pure Java
). I'm interested to help you with development (this problem can't stop
me) but I'm very new in postgres and I need help. Can I turn off this
behaviour ? Is't here some workaround ? If not, know somebody where to
look at first (which part of source code) ?

Thanks for your time and best regards

Pavel


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)



В списке pgsql-jdbc по дате отправления:

Предыдущее
От: "Dave Cramer"
Дата:
Сообщение: Re: Connection Problem with JDBC
Следующее
От: "Peter V. Cooper"
Дата:
Сообщение: Re: newbB: Howto tell if jdbc is compiled-in?