This question is locked. New answers and comments are not allowed.
Hi,
Let's look at the following code:
While executing "query" some SQL exception is raised (for example, it's a call to a stored procedure and a string is supplied (as a parameter) instead of a number). Then, "catch" is activated but when trying to execute "otherQuery" another exception is raised:
The server failed to resume the transaction. Desc:3c00000002.
The question is: what should I do with pScope to make it usable (using another scope is not a solution)? The transaction is not activated before calling myFunc and is still not active when trying to execute otherQuery.
Regards
Tomasz
Let's look at the following code:
public object myFunc(IObjectScope pScope) |
{ |
try |
{ |
Query<myType> query = pScope.GetSqlQuery<myType>(...); |
QueryResultEnumerable<myType> res = query.ExecuteEnumerable(...); |
return res.ToList(); |
} |
catch |
{ |
IQuery otherQuery = pScope.GetSqlQuery(...); |
IQueryResult otherRes = otherQuery.Execute(...); |
int a = otherRes.Count; // execute! |
return null; |
} |
} |
The server failed to resume the transaction. Desc:3c00000002.
The question is: what should I do with pScope to make it usable (using another scope is not a solution)? The transaction is not activated before calling myFunc and is still not active when trying to execute otherQuery.
Regards
Tomasz