I started here: http://stackoverflow.com/questions/753599/implementing-linq-to-sql-transactions-through-wcf
Since then I came to the following. I am using basicHttpBinding for legacy, and my WCF client is unmanaged C++ (gSOAP). So I am using ASP.NET Session and enable aspNetCompatibilityMode on WCF. This works, so now I can handle sessions properly.
Now my idea was to allocate separate LINQ-to-SQL DataContext per each session, and in that way achieve transactional behavior. What I wanted to do is to store the DataContext instance inside the Session, do all the inserts without calling SubmitChanges() and then just call SubmitChanges() once to commit the transaction.
Unfortunately, there is a bug in LINQ-to-SQL which prevents you to fetch previously inserted data from the DataContext before you call SubmitChanges() on it (see here) And I need to do that, because before inserting tender's documents and headers I need to retrieve the tender itself. So this won't work (at least without completely refactoring the code and loosing most of LINQ-to-SQL's beauty...)
So now the question is: how do I properly implement the per-DataContext transaction through WCF? I can't propogate the TransactionScope from the client, because the client is unmanaged. I can't use the internal LINQ-to-SQL transaction because of the bug above. The only thing I have is ASP.NET Session (which works). Perhaps I can store the TransactionScope in Session somehow?