[Dart] problem with Dart2 and PostgreSQL (long)

Blezek, Daniel J (GE, Research) blezek at crd.ge.com
Wed Oct 24 14:26:00 EDT 2007


Hi Ted,

  Welcome to Dart.  Sorry this first experience was so bad...

  I'm afraid the Postgres support has gotten a little stale.  The
"primary key primary key" is a bug, just fixed it.  The startup error
points to why people develop solutions for just one DBMS (of which we
are guilty).  The code that gives the null pointer is this,
Project.java:288:

      // Check if Version table exists
      ResultSet tables = connection.getMetaData().getTables ( null,
null, "%", null );
      boolean FoundVersion = false;
      while ( tables.next() ) {
         if ( tables.getString ( "TABLE_NAME" ).equalsIgnoreCase (
"version" ) ) {
          FoundVersion = true;
        }

Apparently, Postgres uses a different convention than Derby, for which
this code was written.  We could remove the whole check without penalty,
but then we don't know if the table doesn't exist, or the connection
could not be made.  Sigh, SQL left too much room in the specification...

Are you building from source?  If so, you can just comment out this line
in Project.java and give it a go.  OTW I can send you a new
DartServer.jar to try out.

Sorry & thanks,
-dan

-----Original Message-----
From: dart-bounces+blezek=crd.ge.com at public.kitware.com
[mailto:dart-bounces+blezek=crd.ge.com at public.kitware.com] On Behalf Of
Ted Berg
Sent: Wednesday, October 24, 2007 1:42 PM
To: dart at public.kitware.com
Subject: [Dart] problem with Dart2 and PostgreSQL (long)

How solid is the Postgres support in Dart2?  I'm running into problems
setting up a Postgres based project and would like to know if they are
self inflicted or not.

First the Schema.sql file generated for my project seems to have a
number of tables created with duplicate primary keys.

For example:
=====
   create table clientproperty (
     ClientPropertyId bigserial primary key primary key,
   ...
=====

I've gone through the file and removed all of these duplicates, and the
database now initializes correctly.  When I attempt to start the
dartboard project I get the following error:
=====
<24 Oct 2007 13:33:04,523> [main] ERROR dart.server.Server
   Error starting project pgsdk
java.lang.NullPointerException
   at
org.postgresql.jdbc2.DatabaseMetaData.getTables(DatabaseMetaData.java:17
07)
   at dart.server.Project.verifyDatabaseVersion(Project.java:292)
   at dart.server.Server.start(Server.java:352)
   at dart.server.Server.start(Server.java:228)
   at dart.DartServer.main(DartServer.java:159)
<24 Oct 2007 13:33:04,523> [main] FATAL dart.DartServer
   Failed to start DartServer see previous messages =====

The database and tables do appear to exist:
=====
13:38:48 tberg at glamdring ~/tmp/Dart1.0.9 $ psql -l
         List of databases
    Name    |  Owner   | Encoding
-----------+----------+----------
  pgsdk     | root     | UTF8
  postgres  | postgres | UTF8
  template0 | postgres | UTF8
  template1 | postgres | UTF8
  vivox     | root     | UTF8
(5 rows)

13:39:23 tberg at glamdring ~/tmp/Dart1.0.9 $ psql pgsdk Welcome to psql
8.1.10, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
        \h for help with SQL commands
        \? for help with psql commands
        \g or terminate with semicolon to execute query
        \q to quit

pgsdk=# \dt;
             List of relations
  Schema |      Name      | Type  | Owner
--------+----------------+-------+-------
  public | client         | table | tberg
  public | clientproperty | table | tberg
  public | completedtask  | table | tberg
  public | note           | table | tberg
  public | relatedtest    | table | tberg
  public | result         | table | tberg
  public | submission     | table | tberg
  public | taskqueue      | table | tberg
  public | test           | table | tberg
  public | track          | table | tberg
  public | version        | table | tberg
(11 rows)

pgsdk=# \q
13:39:40 tberg at glamdring ~/tmp/Dart1.0.9 $ =====
_______________________________________________
Dart mailing list
Dart at public.kitware.com
http://public.kitware.com/mailman/listinfo/dart


More information about the Dart mailing list