Hi all, Is there a way for an EntityStore to get access to the UoW for which it is being queried for an EntityState? If not, could we create a service like that, or add a parameter to the methods in the EntityStore for some sort of state or ID of the UoW. This could be useful for the EntityStore to be able to associate some kind of state to the UoW. I might be able to use something like this to completely hide the transaction management of the Neo4j back end, while still supporting the same benefits as I discussed in a previous e-mail.
If we are going to have resources (such as transactions in this case) associated with the UoW in the EntityStore it might make sense to add support for notifying the EntityStore when a UoW transfers from one thread to another, so that it may move the resources in the same way. On the top of my head, I would propose a change something like this: * Move the current EntityStore methods to a new Interface called EntitySession (or something like that). * The new EntityStore interface should contain one method: EntitySession getSession(); which gets invoked once for an UoW, the returned session object is then associated with that UoW. * EntitySession should, in addition to the methods from the old EntityStore interface have methods for transfering resources to annother thread: void suspend(); void resume(); or something else which might make more sense to Qi4j, as log as it supports as least as much as suspending and resuming does. These methods will be called for each EntitySession associated with an UoW when pause()/resume() is called on the UoW, perhaps in other cases where/if automatic thread transfer occurs. What do you think? My proposed API changes is of course only my take on it, someone else might be able to come up with a better way of enabling associating resources with UoWs, for example simplified by prohibiting transferring a UoW from one thread to another. regards, -- Tobias Ivarsson <[EMAIL PROTECTED]> Hacker, Neo Technology www.neotechnology.com Cellphone: +46 706 534857 _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

