Has anyone come up with a solution for this? I'm having the same problem. I
haven't tested whether it works with the PersistenceBroker though.
Eric
Subject: ODMG api with m:n mapping.
From: Wara Songkran <paan130 <at> yahoo.com>
Date: Sat, 24 May 2003 02:02:46 -0700 (PDT)
Newsgroups:
<http://news.gmane.org/thread.php?group=gmane.comp.jakarta.ojb.user>
gmane.comp.jakarta.ojb.user
Reply-to: "OJB Users List" <ojb-user <at> db.apache.org>
I'm working on non-decomposed m:n mapping. My code is
---------PersistenceBroker----------------
Car c = new Car();
Cylinder s = new Cylinder();
Collection col = new ArrayList();
col.add(s);
c.setAllSpareparts(col);
broker.store(c);
----------ODMG-----------------------------
Transaction tx = null;
Car c = new Car();
Cylinder s = new Cylinder();
Collection col = new ArrayList();
col.add(s);
c.setAllSpareparts(col);
try {
tx = odmg.newTransaction();
tx.begin();
tx.lock(c,Transaction.WRITE);
tx.commit();
} catch (LockNotGrantedException e) {
e.printStackTrace();
}
when I use PresistenceBroker it's work fine but with
odmg api it cause error.
[org.apache.ojb.odmg.ObjectEnvelopeTable] ERROR:
Commit on object level failed for tx
[EMAIL PROTECTED]
Invalid argument value: Duplicate entry '121' for key
1
I'm using mysql and all table is InnoDB.
please help.
DISCLAIMER: The information contained in this e-mail is, unless otherwise
indicated, confidential and is intended solely for the use of the named
addressee. Access, copying or re-use of the e-mail or any information
contained therein by any other person is not authorized. If you are not the
intended recipient please notify us immediately by returning the e-mail to
the originator.