Print Page | Close Window

Should I use a single PersistenceManager or many?

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=228
Printed Date: 29-Aug-2025 at 8:06pm


Topic: Should I use a single PersistenceManager or many?
Posted By: Customer
Subject: Should I use a single PersistenceManager or many?
Date Posted: 12-Jul-2007 at 4:37pm

 How to use a PersistenceManager with two forms?

-Use a separate PersistenceManager for each editing space or
-Use a single PersistenceManager
 



Replies:
Posted By: IdeaBlade
Date Posted: 12-Jul-2007 at 4:40pm
Actually, you have three choices
  • One PM
  • Multiple PM’s
  • A hybrid approach

I would advise you to start with just a single PM.  This is certainly the easiest approach.  It is also the most consistent approach in that each form represents the same view of any particular business object as any other form.

 

Consider multiple PM’s if you want any additions, deletions, or changes in one form not to be present in any other form until you save the first form.  In addition, you can do an Undo on one form independent of the state of another,  The disadvantage of using multiple PM’s is that managing them can be complex.  Moving changes from one PM can be tricky (for example, you’ll have to deal with possible concurrency conflicts).

 

Finally, there is the hybrid approach.  View the TechTip which uses theGetEntityGraph at

http://www.ideablade.com/techtip_saving_by_form.htm

 

Now that I have confused you, I would strongly recommend that you start with a single PM.  If after you have success with this approach, you might look at other alternatives.

 



Print Page | Close Window