On Fri, Nov 20, 2009 at 3:20 PM, Rickard Öberg <[email protected]> wrote:
> Nested UoW code needs to be cleaned up, yes, but the semantics I think are > reasonably clear. If you do something in a top UoW and then create a nested > UoW, then the nested UoW should see the modified state from the parent, > along with "fresh" state from the EntityStore if it has not been > loaded/modified in the parent UoW. But, UnitOfWork uow1 = uowf.newUnitOfWork(); UnitOfWork uow2 = uowf.newUnitOfWork(); is allowed and will 'push' uow2 on top of uow1, but they are not related, i.e. nothing to do with 'nested'. Yet, if I the do; uow1.discard() the uow1.close() will be called, and there we do a stack.pop(), i.e. remove the uow2 and letting uow1 be current unit of work, but closed. This is a bug one way or the other, and the stack.pop() should either be changed to stack.remove( uow ), or protest if uow1 is closed before uow2, or ...? But that apart, am I supposed to be allowed to use these two UOWs independently of each other, or is it required that some kind of 'order' to be respected? Then continue from there, one can do; uow1.pause(); uow1.resume(); which also works on TopOfStack, without checking if it is the current top. I can help fixing this up, but only if the semantics are well understood, and it is not well understood by me at the moment. Cheers -- Niclas Hedhman, Software Developer http://www.qi4j.org - New Energy for Java I live here; http://tinyurl.com/2qq9er I work here; http://tinyurl.com/2ymelc I relax here; http://tinyurl.com/2cgsug _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

