Actions
Architecture #2777
closedAdd Box in ReportsRepository method APIs
Status:
Rejected
Priority:
3
Assignee:
Category:
Architecture - Code maintenance
Target version:
Pull Request:
Effort required:
Name check:
Fix check:
Regression:
Description
ReportsRepository method can fail, for example on a database connection problem.
That must be reflected in ReportsRepository method type with Box[...].
For example:
def findReportsByNode( nodeId : NodeId , ruleId : RuleId , serial : Int , beginDate: DateTime , endDate : Option[DateTime] ): Seq[Reports]
Should be:
def findReportsByNode( nodeId : NodeId , ruleId : RuleId , serial : Int , beginDate: DateTime , endDate : Option[DateTime] ): Box[Seq[Reports]]
Moreover, implementation of ReportsRepository like ReportsJdbcRepository must handle error case. Typically, ReportsJdbcRepository must boxes all call to "jdbcTemplate.query" in a try/catch.
See #2709 and commit 27ddf8848d448943a67d028025fb12c9bf533eee for a place where such a modification is important. That also means that DatabaseManager will have to be modified to remove the try/catch.
Actions