Thanks for the reply.
On Sun, Nov 14, 2010 at 4:30 AM, Koen Deforche <[email protected]> wrote:
> Hey,
>
> 2010/11/12 E L <[email protected]>:
>> Hello
>>
>> When I hit a stale object exception, the code can not continue from
>> that using the try/catch structure shown in attached file.
>
> The problem is that since the object is dirty, going out of scope does
> not actually purge the in-memory version. Consider the scenario where
> you modify several objects in a transaction and then finally commit
> them. You would not expect that only those objects that still are
> in-scope are saved.
>
> I believe that the missing piece here is a "Session::rereadAll()"
> method which discards all modified objects, as a catch-all solution to
> a StaleObjectException ?

For my uses, I think a function to just purge all the modified objects
would be more helpful than a reread.  After trying to modified rows in
the db and having it fail, I will just go back through the same
query/iteration again (also I will not have dbo pointers for most of
the rows), so a reread would just be redundant.  Maybe I'm not making
full use of the data persistence, but most of the db objects I use are
short lived.

Eric

------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to