The following code:
var foo = Users.Join(
tvf_SearchUsers(queryString),
u => u.User_Id,
s => s.User_Id,
(u, s) => u);
Selects users that match the query string based on a table valued function (tvf_SearchUsers), which utilises full text search. This code snippet is part of a larger method which works successfully when used in production. However, when I call the same method as part of an MBUnit test, which has a rollback attribute, the search fails to return the expected results. If I remove the rollback attribute, it works correctly. The unit test creates dummy users etc which are then cleaned up by the rollback. It seems that these created items are not being seen by the table valued function, as though it were outside the transaction scope. Does anyone know how to get around this?
Updated
If I replace the full text search functionality with a simpler query in the tvf the operation proceeds as expected. So the issue has something to do with the full text search. I'm using SQL Server 2008 so afaik SQL Server should be able to keep the full text query in transaction scope.