You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by Jonathan Feinberg <jd...@us.ibm.com> on 2007/04/18 20:52:56 UTC

Spurious warnings during runtime schema update

When SychronizeMappings is set to buildSchema, as it always is for me (in head-down development mode), every run of unit tests or app server is prefaced by a large collection of spurious warnings. A specimen:
3635  myproj   WARN   [http-8080-Processor24] openjpa.jdbc.Schema - Existing column "id" on table "public.share" is incompatible with the same column in the given schema definition. Existing column:
Full Name: share.id
Type: char
Size: 32
Default: null
Not Null: true
Given column:
Full Name: Share.id
Type: varchar
Size: 255
Default: null
Not Null: true
Now, the existing column was, of course, originally created (correctly) as a char(32) by the same schema update routine, thanks to the following annotation on the field in question:
 @Id
 @GeneratedValue(generator = "uuid-hex")
 @Column(columnDefinition = "char(32)")
 public String getId()
 {
  return id;
 }
Why does the schema sync complain? I have tried asking the sync to read schema, a la
<property name="openjpa.jdbc.SynchronizeMappings"
    value="buildSchema(ReadSchema=true)" />
but it made no difference.

Thanks,
-- 

Re: Spurious warnings during runtime schema update

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 4/18/07, Jonathan Feinberg <jd...@us.ibm.com> wrote:

> When SychronizeMappings is set to buildSchema, as it always is for me (in  head-down development mode), every run of unit tests or app server is prefaced  by a large collection of spurious warnings. A specimen:
>
> 3635  myproj   WARN      [http-8080-Processor24] openjpa.jdbc.Schema - Existing column "id" on table    "public.share" is incompatible with the same column in the given schema    definition. Existing column:
> Full Name: share.id
> Type: char
> Size:    32
> Default: null
> Not Null: true
> Given column:
> Full Name:    Share.id
> Type: varchar
> Size: 255
> Default: null
> Not Null:  true

What database are you using? Have you tried to run it against another
db? I suspect it might be related to the db.

Could you try out the following setting in your persistence.xml:

<property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(SchemaAction='add,deleteTableContents')" />

? What's the result?

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl