ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google

Mail Archive Home | enhydra List | September 2000 Index

<--  Date Index  --> <--  Thread Index  -->

Enhydra: DODS/PostgreSQL and the serial datatype

I'm writing an app that requires a database field to be incremented so
that the record can be identified by the unique field.  The problem is
that DODS doesn't understand what the PostgreSQL datatype 'serial' is
and instead of leaving it alone it tries to insert a 0 into the id
field.  The first insert works because 'id' is set to 0 but on
subsequent inserts the id field is not incremented (left at 0) and I get
this message:

        java.sql.SQLException: Failed to insert/update DO: ERROR:
Cannot insert a duplicate key into unique index article_id_key

Has anyone else run into this problem?  How can I make the DataObject
leave the field alone so that the DB can do its thing?  If I use
straight JDBC it works like a charm but I really want to stick with the
abstraction that a DataObject gives me.  It has already been a real life

I know I can handle  incrementing the field in a PO but I don't want to
because I figure that letting the database handle the work would be more
efficient.  If I'm wrong please let me know.



To unsubscribe from this mailing list, send email to majordomo@xxxxxxxxxxx
with the text "unsubscribe enhydra" in the body of the email.
If you have other questions regarding this mailing list, send email to
the list admin at owner-enhydra@xxxxxxxxxxxx

<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.