Print Page | Close Window

Negative Ids using PersistenceManager.ImportEntities

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=218
Printed Date: 16-Apr-2025 at 8:45am


Topic: Negative Ids using PersistenceManager.ImportEntities
Posted By: Customer
Subject: Negative Ids using PersistenceManager.ImportEntities
Date 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.




Replies:
Posted By: IdeaBlade
Date Posted: 12-Jul-2007 at 4:02pm
This a known bug in ImportEntities fixed in DevForce 3.5.0.1 (released 3/30/2007).



Print Page | Close Window