NWorkspace, tx API

When I first started discussing NWorkspace at SwedArch, the most common comment I received was that it lacked an interface for explicit transactions. I might add this later, but for now I'm trying to keep the requirements down as much as possible in order to create something very simple, yet useful. It's a balancing act and I'm not sure I have found it yet. Anyway, here goes.

When you do a _ws.PersistAll(), it will always be wrapped in a transaction behind the scenes. If there is a problem, there will be a rollback. This happens even if you have only one dirty object. First of all, it's simpler that way and the overhead is most likely very low. What might also happen is that the mapping for the class is to two different tables. So when you think you are updating only one table (because it was just one class), in reality it might be two updates, and an explicit transaction is necessary as otherwise it would become two implicit transactions (and this is especially troublesome if over time the mapping is changed from one table to two tables.)

That was about INSERT, UPDATE and DELETE. When using GetById() and GetByQuery(), SELECTs are used. By default SELECTs will not get an explicit transaction in NWorkspace, but will execute in their own implicit transactions. The exception to this rule is if you want to hold on to readlocks until PersistAll(). In this case you have to say BeginReadTransaction() before you start reading, and send a transaction isolation level as argument.

Another thing that is supported (only after BeginReadTransaction()) is using an overload to GetById() and GetByQuery() to say that you want to get "exclusive locks" for those situations when you would otherwise risk getting a conversion deadlock. This should be used with care, of course.
:-)

Finally, if you want to forget about all the changes you have done, without persisting them to the database with PersistAll(), you call Clean().

I think that's it for the moment. Comments?