Enumerating connection properties
Mateusz Loskot
mateusz at loskot.net
Mon Oct 23 17:37:01 EDT 2006
Hi,
I'd like to ask for clarification of behavior of connection
properties API when using RDBMS provider, ie. existing OSGeo.MySQL3.2
The main question is:
Do I need to open a connection before I call
FdoIConnectionPropertyDictionary::EnumeratePropertyValues() ?
I believe I know the overall procedure in details,
but I'm not sure I understand how the EnumeratePropertyValues()
is expected to work.
I CreateConnection(), next GetConnectionInfo() and finall fetch
properties using GetConnectionProperties().
Now, I loop through properties and check if given every property
IsPropertyEnumerable() and if it is, then I call
EnumeratePropertyValues() to fetch
a) number of enumerable values of partibular property and
b) pointer to array, if there are any elements available
Note, that I have not called Open() to open connection yet.
Now, the problem is every time I call EnumeratePropertyValues()
(for property that is enumerable) following exception is thrown:
"Connection not established"
I tracked the call chain and for RDBMS provider, the exception is thrown
from FdoRdbmsConnectionPropertyDictionary::EnumeratePropertyValues()
In lines 37-38, following condition is FALSE:
if((mConnection == NULL)
|| (mConnection->GetConnectionState() == FdoConnectionState_Closed))
throw FdoCommandException::Create(NlsMsgGet(FDORDBMS_13,
"Connection not established"));
I don't understand why EnumeratePropertyValues() expects the connection
has been established. According to FDO Dev Guide, the Open() action is
executed in Step 5 (Page 37) and looping connection properties, not before.
Am I missing something?
p.s. Please, if my question is not clear or unanswerable,
I'd appreciate a note about it, then I will have a chance to explain
it clearer.
Cheers
--
Mateusz Loskot
http://mateusz.loskot.net
More information about the Fdo-internals
mailing list