Todo: Several dbAccess:: methods improperly return a error flag

Bug #722705 reported by Rick Stovall
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
New Real Time Battle
Won't Fix
High
George Jordan

Bug Description

Method int dbAccess::runSql (string scrpt) returns an int indicating success or failure and carrying no other significance. Best practices indicate that the method should succeed cleanly or throw an exception, therefore the return of a status flag is redundant; a failure would never return the error code in any case.

Given the above, the method should be altered to not return any type of status code and to throw an exception (may I suggest dbAccess::runSql_failure as a name) should the query fail. A nice enhancement would be to store the error code and text in the exception so the actual event and problem can be resolved by the caller if needed.

One other question while we are here, was the mis-spelling of "script" in the argument list intentional?

Tags: dbaccess
Revision history for this message
Rick Stovall (fpstovall) wrote :

I altered this bug to generally include all the dbAccess:: methods which return a status int. Please make the changes noted above in each of those cases, using distinct and meaningful exception names, of course.

summary: - method dbAccess::runSql (string scrpt) improperly returns a error flag
+ Several dbAccess:: methods improperly return a error flag
Revision history for this message
Rick Stovall (fpstovall) wrote : Re: Several dbAccess:: methods improperly return a error flag

Altered status to reflect this is still open to debate.

Changed in nrtb:
status: New → Opinion
status: Opinion → Incomplete
status: Incomplete → Opinion
Rick Stovall (fpstovall)
Changed in nrtb:
status: Opinion → Incomplete
Rick Stovall (fpstovall)
summary: - Several dbAccess:: methods improperly return a error flag
+ Todo: Several dbAccess:: methods improperly return a error flag
Changed in nrtb:
status: Incomplete → In Progress
Changed in nrtb:
status: In Progress → Triaged
tags: added: dbaccess
Changed in nrtb:
status: Triaged → In Progress
Changed in nrtb:
status: In Progress → Fix Committed
Revision history for this message
Rick Stovall (fpstovall) wrote :

Abandoned.. overrun by the port to D

Changed in nrtb:
status: Fix Committed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.