Reading new entity during transaction?

Posts   
 
    
zebranky
User
Posts: 24
Joined: 14-Mar-2006
# Posted on: 25-Jul-2006 11:08:30   

Hi all,

I have a question regarding Self-Servicing and reloading a recently saved entity during a transaction: Is it possible? simple_smile

This is the scenario: I have a transaction configured using IsolationLevel.ReadCommitted (the only one of 2 options I have for transactions in self-servicing). During this transaction I save a number of entities. Near the end of the transaction I want to 'reread'/'refresh'/'reselect' some of the newly inserted entities to process them again (the reason for this is as a workaround test for this issue: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=6996).

If I do try to reload an entity by using its primary key constructor overload, after it was inserted within the same transaction, LLBLGEN gives me a new entity, not the one I saved. I am not entirely sure if this is possible with self-servicing, as I think I may need an IsolationLevel.ReadUncommitted transation which is not supported in self-servicing?

Any ideas/suggestions?

Thanks, Brian Johnson

Jessynoo avatar
Jessynoo
Support Team
Posts: 296
Joined: 19-Aug-2004
# Posted on: 25-Jul-2006 16:21:01   

Hi,

Did you try the method "Refetch()"? It's purpose is precisely to reload an entity after it's out of sync with the persistence storage due to a saving query.