Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> UnitOfWork saved entities
 

Pages: 1
LLBLGen Pro Runtime Framework
UnitOfWork saved entities
Page:1/1 

  Print all messages in this thread  
Poster Message
TomV
User



Location:
Belgium
Joined on:
31-Jan-2008 14:22:10
Posted:
76 posts
# Posted on: 16-Jun-2008 12:33:36.  
Hi,

I'm using an UnitOfWork to save my entities. Everything works just fine Laugh
But when the save (process of unit of work) is done, I would like to get all adapted entities. I want to know which entities were inserted/updated/deleted to or from the persistent storage. I need these to send to our server (Genuine Channels) so this server can inform all clients that an entity has been changed and that they should update the object (and corresponding forms/screens) if they use the adapted entity.

I've been playing around with the UnitOfWork, but after the save I'm unable to access the deleted entities. Can you please help me out on this one and give me the best way to handle my problem.

The only alternative is that I use the GetCollectionElementsToDelete before I process the unit of work. But maybe there's a more elegant way to handle this 'problem'

The nicest solution for me would be an collection with all adapted entities, like uow.GetAllAdaptedEntities(), but I guess this is wishfull thinking Wink

Kind regards
TomV
Life goes fast, it must be riding a Ducati!  Top
goose
User



Location:
Central America
Joined on:
06-Aug-2007 18:21:05
Posted:
385 posts
# Posted on: 16-Jun-2008 19:14:51.  
I beleive there is not a nicest solution available at the moment.

gansodesoya  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
37375 posts
# Posted on: 17-Jun-2008 14:18:12.  
Call: ConstructSaveProcessQueues()
this creates the save queues. You can then obtain the save queues (insert/update) by using:
GetInsertQueue and GetUpdateQueue.

To obtain the entities to delete, use GetCollectionElementsToDelete and GetEntityElementsToDelete
Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
TomV
User



Location:
Belgium
Joined on:
31-Jan-2008 14:22:10
Posted:
76 posts
# Posted on: 18-Jun-2008 19:18:29.  
Hi Otis,

Thanks for your reply. I'll give it a try.

Kind regards
TomV


Life goes fast, it must be riding a Ducati!  Top
TomV
User



Location:
Belgium
Joined on:
31-Jan-2008 14:22:10
Posted:
76 posts
# Posted on: 24-Jun-2008 15:19:47.  
Hi,

It works. I first call the ConstructSaveProcessQueues() method. Before I process my unit of work I loop over GetCollectionElementsToDelete and GetEntityElementsToDelete collection. After the save, I loop the Insert and Update queue. By this I have all saved entities and can pass them all to our synchronisation server (Genuine Channels).

Problem solved!

Kind regards,
TomV
Life goes fast, it must be riding a Ducati!  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.