Re: PostgeSQL problems (Boolean vs Bit)

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Nov 10 2005 - 02:15:01 EST

  • Next message: Andrus Adamchik: "Re: PostgeSQL problems (Boolean vs Bit)"

    You didn't post the full stack, but I assume this happens on insert
    when the class generation attempt is made? Here is a few things to
    check.

    1. You may have the wrong adapter set. In M7 Cayenne can auto-detect
    database type and install the right adapter in runtime. However if
    you were using the older model with adapter already set (and made a
    mistake, entering the wrong adapter), auto detection mechanism will
    not override that. So open your project in the M7 modeler, navigate
    to the DataNode, select "Adapter" tab, and delete the entry in the
    "Custom Adapter" field.

    2. Cayenne PostgresAdapter started using sequences since M3.
    Doublecheck that you don't have an older jar somewhere in classpath
    (like 1.1.x or something).

    Hope this helps.

    Andrus

    > Um, I just realised that:
    >
    > 1) The Java and SQL I was using was generated by the 1.2M6 release,
    > while
    > the JAR was 1.2M7.
    > 2) I was using the Click example's init filter to generate the DB.
    >
    > I've regenerated the DB, manually using the 1.2M7 SQL, and Java
    > Code and
    > now the DB is using boolean in stead of BIT(1), but I still have a
    > problem.
    > I'm getting an exception:
    >
    > org.postgresql.util.PSQLException: ERROR: relation
    > "auto_pk_support" does
    > not exist
    > at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse
    > (QueryExecutorImpl.java:1501)
    >
    > The exception is correct there is not auto_pk_support table, but it
    > appears
    > that the SQL generated by the modeler is generating sequences for
    > PK's.
    >
    > Is there anything I can do to fix this?



    This archive was generated by hypermail 2.0.0 : Thu Nov 10 2005 - 02:15:03 EST