Java Mailing List Archive

http://www.gg3721.com/

Home » users.openjpa »

sql errors on postgres / openjpa 1.1

roger.keays

2008-06-27

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi,

I've had a few SQL errors under 1.1 due to missing column names. The
latest one looks like this:

Caused by: <openjpa-1.1.0-SNAPSHOT-r422266:657918 nonfatal general
error> org.apache.openjpa.persistence.PersistenceException: ERROR:
syntax error at or near "WHERE" {prepstmnt 10993018 UPDATE CMS_BLOBS SET
WHERE id = ? [params=(long) 61]} [code=0, state=42601]
FailedObject:
au.com.ninthavenue.cms.entities.Blob-au.com.ninthavenue.cms.entities.Blob-61


The code is roughly

blob.setAttachedTo(item);
item.getAttachments().add(blob);

em.getTransaction().begin();
em.persist(item);
em.getTransaction().commit();


item.attachments is CASCADE-ALL, and blob.attachedTo is CASCADE-MERGE. I
can't set the relationships inside the transaction because of the way
our code is executed. Both are new objects. I would have expected the
SQL to do SET attachedTo_id = ? WHERE id = ?

Any suggestions would be appreciated.

Thanks,

Roger

©2008 gg3721.com - Jax Systems, LLC, U.S.A.