Open robstein opened 10 years ago
The error occurs when the users mashes the relevance buttons. The solution is to lock the insert function, so it can only happen once the previous update returns.
I'm having trouble db bug by reenacting the relevance button mashing cause. ..maybe this won't be an issue. Come back to this later and write a scrip in the insert that notices if there are ever more than 1 result, and takes the most recent one.
Log entry details
ERROR
Error occurred executing query: Error: [Microsoft][SQL Server Native Client 10.0][SQL Server]Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
The subquery that the log refers to is "select input from relevance where user_id = ? and story_id = S.id".
This subquery should hypothetically never return more than one result. There should only be 1 relevance record for each unique user for each story.
In the client code, we simply insert each new relevance input. The relevance table's insert script updates if there is matching record : function insert(item, user, request) {
}