Hello,

to replace an Object in my Database, I do the following:

db.begin();
Product old = (Product)db.load(Product.class, new Integer(99));
db.remove(old);
Product new = new Product();
new.setId(99);
//....
db.create(new);
db.commit();

But I'm getting 
org.exolab.castor.jdo.DuplicateIdentityException: Duplicate identity
found for object of type Product with identity 99: an object with the
same identity already exists in persistent storage

Is this a bug? I deleted the object with id 99 before, but did not
commit it. I don't want to commit, because if creation fails, the old
Object would be lost. I also can't modify the old one, because I had to
modify each of it's fields. It's much easyer to replace it completly. 

Thanks for reply,
Thomas

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to