Fix transaction visibility issue in Initialize service
Showing
1 changed file
with
9 additions
and
3 deletions
| ... | @@ -119,9 +119,15 @@ | ... | @@ -119,9 +119,15 @@ |
| 119 | def userId = ec.user.userId | 119 | def userId = ec.user.userId |
| 120 | def userAccountId = userId ? userId : null | 120 | def userAccountId = userId ? userId : null |
| 121 | 121 | ||
| 122 | // Get user-specific tools and resources | 122 | // Get user-specific tools and resources in SAME transaction context |
| 123 | def toolsResult = ec.service.sync().name("McpServices.mcp#ToolsList").parameters([sessionId: visit.visitId]).call() | 123 | def toolsResult = ec.service.sync().name("McpServices.mcp#ToolsList") |
| 124 | def resourcesResult = ec.service.sync().name("McpServices.mcp#ResourcesList").parameters([sessionId: visit.visitId]).call() | 124 | .parameters([sessionId: visit.visitId]) |
| 125 | .requireNewTransaction(false) // Use current transaction | ||
| 126 | .call() | ||
| 127 | def resourcesResult = ec.service.sync().name("McpServices.mcp#ResourcesList") | ||
| 128 | .parameters([sessionId: visit.visitId]) | ||
| 129 | .requireNewTransaction(false) // Use current transaction | ||
| 130 | .call() | ||
| 125 | 131 | ||
| 126 | // Build server capabilities based on what user can access | 132 | // Build server capabilities based on what user can access |
| 127 | def serverCapabilities = [ | 133 | def serverCapabilities = [ | ... | ... |
-
Please register or sign in to post a comment