New Posts New Posts RSS Feed: Negative Ids using PersistenceManager.ImportEntities
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Negative Ids using PersistenceManager.ImportEntities

 Post Reply Post Reply
Author
Customer View Drop Down
Senior Member
Senior Member
Avatar
User Submitted Questions to Support

Joined: 30-May-2007
Location: United States
Posts: 260
Post Options Post Options   Quote Customer Quote  Post ReplyReply Direct Link To This Post Topic: Negative Ids using PersistenceManager.ImportEntities
    Posted: 12-Jul-2007 at 4:01pm

I have 2 PM’s setup.  On PM1 I create a Batch entity that contains no Batch.Bills and has a BatchID of -1.  I then import the BatchEntity into PM2 which has just been created and has no entities in its cache.  The Batch entity still has an ID of -1.  I do a bunch of work and now Batch.Bills is not empty.  I then build an ArrayList containing Batch, Batch.Bills and import that ArrayList into PM1 with MergeStrategy.OverwriteChanges.  When Batch goes into PM1 its BatchID changes from -1 to -2 and all Batch.Bills now reference -2. 

1)      Why does it switch the ID on me?

2)      Can I stop it from switching the ID?

3)      How do I get a reference to Batch?  I can’t get it by ID because it’s changed.  I can’t get it by RowState because PM1 could have any number of new Batch entities.

Back to Top
IdeaBlade View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 30-May-2007
Location: United States
Posts: 353
Post Options Post Options   Quote IdeaBlade Quote  Post ReplyReply Direct Link To This Post Posted: 12-Jul-2007 at 4:02pm
This a known bug in ImportEntities fixed in DevForce 3.5.0.1 (released 3/30/2007).
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down