Edward Yakop wrote:
> Niclas pointed out that I did newUnitOfWork wrongly.
> 
> If I did uowf.newUnitOfWork(), I get this exception:
>> This exception is thrown:
>>
>> org.qi4j.entity.UnitOfWorkException: Unit of work has been closed
>>        
>> org.qi4j.runtime.entity.UnitOfWorkInstance.checkOpen(UnitOfWorkInstance.java:620)
>>        
>> org.qi4j.runtime.entity.UnitOfWorkInstance.module(UnitOfWorkInstance.java:519)
>>        org.qi4j.runtime.query.EntityQuery.loadEntity(EntityQuery.java:156)
>>        org.qi4j.runtime.query.EntityQuery.access$000(EntityQuery.java:37)
>>        org.qi4j.runtime.query.EntityQuery$1.next(EntityQuery.java:111)
>>        
>> org.qi4j.samples.dddsample.spring.ui.CargoTrackingViewAdapter.<init>(CargoTrackingViewAdapter.java:35)
>>        
>> org.qi4j.samples.dddsample.spring.ui.CargoTrackingController.onSubmit(CargoTrackingController.java:56)
> 
> But if I did uowf.currentUnitOfWork().newUnitOfWork()
> None of the domain entities could be found. Because the entities are
> stored within domain layer scope.

This I think is a bug. Currently the nested UoW uses the visibility of 
the original module. It should be the visibility of the module that 
creates it, I think. This takes a bit of trickery to accomplish, but 
it's doable.

The same problem you outlined still remains though.

/Rickard

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to