[fdo-internals] [Select] Empty reader or NULL?

Greg Boone greg.boone at autodesk.com
Mon Mar 19 22:07:36 EDT 2007

In this specific case, I would image that an exception would be thrown
stating that 'class non-existing-feature-class-name does not exist'.

In other cases, where no valid data is available for return, but an
exception is not warranted, I would recommend not returning NULL. I
recommend returning an instantiated Reader. When the user calls
ReadNext(), it will return false.


-----Original Message-----
From: fdo-internals-bounces at lists.osgeo.org
[mailto:fdo-internals-bounces at lists.osgeo.org] On Behalf Of Mateusz
Sent: Monday, March 19, 2007 8:43 PM
To: fdo-internals
Subject: [fdo-internals] [Select] Empty reader or NULL?


I'd like to ask about semantic details of FdoISelect::Execute()
operation, especially in DBMS provider.

For instance, if a feature class is directly mapped to table in a
Let's imagine the code below is called by a client:

// Connection is Open
FdoPtr<FdoIConnection> conn;

FdoPtr<FdoISelect> cmd;
cmd = static_cast<FdoISelect*>(
assert(0 != cmd);

// NOTE: Querying non-existing class

// XXX - What Execute() is supposed to return here?
FdoPtr<FdoIFeatureReader> reader = cmd->Execute();

My question is as in line marked with XXX:
If a client queries for a feature class that does not
exist (a non-existing table), what the Execute() operation is supposed
to return?

Is it safe to return NULL pointer to a reader?

Or it should return a kind of empty (terminating) reader, however here I
have no idea how to achieve this kind of feature.

Or an exception is thrown from Execute()?

Mateusz Loskot
fdo-internals mailing list
fdo-internals at lists.osgeo.org

More information about the fdo-internals mailing list