users@glassfish.java.net

Re: findByPrimaryKey returns JDO76012: Object not found for this Object

From: <glassfish_at_javadesktop.org>
Date: Wed, 13 Jun 2007 17:19:26 PDT

I'm using PostgreSQL. I finally found what was wrong. You gave me a hint here:

«Could you try
changing the column names in sun-cmp-mappings.xml to upper case?»

I didn't have to change my column names in uppercase. But you made me think that pgAdmin III was showing me this strange behavior for which I gave no importance at first: when I create the table this way

CREATE TABLE customer
(
  login character varying(16) NOT NULL,
  name character varying(64),
  email character varying(64),
  address1 character varying(64),
  address2 character varying(64),
  CONSTRAINT pk_customer PRIMARY KEY (login0)
)

PostgreSQL is changing it this way:

CREATE TABLE customer
(
  "login" character varying(16) NOT NULL,
  name character varying(64),
  email character varying(64),
  address1 character varying(64),
  address2 character varying(64),
  CONSTRAINT pk_customer PRIMARY KEY ("login")
)

PostgreSQL change case insesitive column names to case sensitive when they are SQL keywords, like "login" or "location". I don't like it, but at least my problem is solved! I changed the "login" column name. Thanks :-))
[Message sent by forum member 'phill68' (phill68)]

http://forums.java.net/jive/thread.jspa?messageID=222043