In looking at the code for:
/reactor/data/mssql/ObjectDao.cfc
in the method "readObject", a stored procedure is run with the return result
set to the query "qObject". Immediately after the stored procedure, an
object's set methods are called using values in the qObject query. After
these sets, a check to make sure this query returned any rows is done, if
not, an exception "Reactor.NoSuchObject" is thrown. Now, you can get this
exception to be thrown by changing the name of the underlying DB table, but
if you do this, another exception is thrown which relates to trying to call
those sets (setType() to be exact) using an empty record set. Doesnt it make
more sense to wrap the sets in an if recordCount check before assuming there
is data to be read in it?
E.g.
<cfif qObject.recordCount EQ 1>
<cfset
arguments.Object.setDatabase(qObject.TABLE_QUALIFIER) />
<cfset
arguments.Object.setOwner(qObject.TABLE_OWNER) />
<cfset arguments.Object.setType(qObject.TABLE_TYPE)
/>
<cfelse>
<cfthrow type="Reactor.NoSuchObject" />
</cfif>
/Cody
-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/