我的错误非常疯狂。我想调试我的错误。 插入log.info $游戏,错误消失了。
代码:
private void calcAndUpdateStatEntriesOfOutOfOrderGame(Game game, Team team) {
Competition competition = game.round.competition
Round currentRound = competition.currentRound
// if game of team has been played in current round -> update stats of current round
// if not => update previous round
Round statsRound
if (game.state > Game.STATE_NOT_STARTED) {
statsRound = currentRound // the stats of the game are saved to the current round of the competition
} else {
// the home team did not yet play yet at the current round -> save the stats at the previous round, otherwise it will be overwritten when the game is played
statsRound = currentRound.previousRound
}
CompetitionTableEntry compTableEntry = CompetitionTableEntry.getByRoundAndTeam(statsRound, team) // get the stats for home team / round of game
if (!compTableEntry) {
// looks like there are no stats created for this round yet => create them
createCompetitionRankingEntries(statsRound, false)
compTableEntry = CompetitionTableEntry.getByRoundAndTeam(statsRound, team)
}
def stats = getStatisticsForTeamUntilGame(competition, game, team)
compTableEntry.properties = stats
compTableEntry.save()
}
错误:
Error 500: Executing action [updateResult] of controller [at.ligaportal.GameController] caused exception: collection [at.ligaportal.Team.staffMembers] was not processed by flush()
Servlet: grails
URI: /ligaportal/grails/game/updateResult.dispatch
Exception Message: collection [at.ligaportal.Team.staffMembers] was not processed by flush()
Caused by: collection [at.ligaportal.Team.staffMembers] was not processed by flush()
Class: ApiAuthenticationFilter
At Line: [77]
Code Snippet:
当我在Round currentRound = competition.currentRound
行之后添加
log.info "$game"
错误消失了,一切正常。 但这是我无法解决的问题......
我的真正问题在哪里?