db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jakub Piechnik" <piech...@wp.pl>
Subject Example problem
Date Thu, 19 May 2005 20:06:54 GMT
Hi

I'm trying to learn Torque by compiling an example project that is placed in tutorial. I'm
using POSTGRESQL 8.0,2 with JDBC POSTGRESQL-8.1dev-400.jdbc3.jar - after command maven torque
- everything is generated ok. I manage to create database and insert tables by myself - because
maven torque:create-db failed (it was written that my jdbc driver can not be found - but it
was included in CLASSPATH). Output was:

psql:project-schema.sql:5: ERROR:  table "book" does not exist
psql:project-schema.sql:18: NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
"book_pkey" for table "book"
CREATE TABLE
psql:project-schema.sql:24: ERROR:  table "publisher" does not exist
psql:project-schema.sql:32: NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
"publisher_pkey" for table "publisher"
CREATE TABLE
psql:project-schema.sql:38: ERROR:  table "author" does not exist
psql:project-schema.sql:47: NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
"author_pkey" for table "author"
CREATE TABLE
ALTER TABLE
ALTER TABLE

I understand errors, because table wasn't in database, so it can not be dropped. But what
is that NOTICE? There are another fileds created? 
After compiling whole programme (Strp 4 in tutorial) when I was trying to perform the example
programme - I counted errors - connected with NOTICE information form executing sql scripts
(generated by Torque). These errors were:

org.apache.torque.TorqueException: org.postgresql.util.PSQLException: ERROR: duplicate key
violates unique constraint "publisher_pkey"
        at org.apache.torque.util.BasePeer.throwTorqueException(BasePeer.java:200)
        at org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:867)
        at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:706)
        at com.kazmier.om.BasePublisherPeer.doInsert(Unknown Source)
        at com.kazmier.om.BasePublisherPeer.doInsert(Unknown Source)
        at com.kazmier.om.BasePublisher.save(Unknown Source)
        at com.kazmier.om.BasePublisher.save(Unknown Source)
        at com.kazmier.om.BasePublisher.save(Unknown Source)
        at com.kazmier.Bookstore.main(Unknown Source)
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key violates unique constraint
"publisher_pkey"
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1471)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1256)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:330)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:282)
        at com.workingdogs.village.Record.saveWithInsert(Unknown Source)
        at com.workingdogs.village.Record.save(Unknown Source)
        at com.workingdogs.village.Record.save(Unknown Source)
        at org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:863)
        ... 7 more

It occured when I was trying to make firs save() after creating new author. (line 24 in code).

I have no idea what is wrong and how could I solve it out. i would be grateful for any help

Greetings 

Jakub Piechnik

----------------------------------------------------
ZOBACZ SERWIS SPECJALNY "Gwiezdne Wojny" 
dla maniaków, ciekawych tego fenomenu i totalnych starwarsowych laików
Kliknij: http://klik.wp.pl/?adr=http%3A%2F%2Ffilm.wp.pl%2Fp%2Fstarwars%2Findex.html&sid=386



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message