[fdo-dev] Enumerating connection properties

Romica Dascalescu Romica.Dascalescu at autodesk.com
Mon Oct 23 18:32:35 EDT 2006


The example is not up to date.

Regards,
Romica.

-----Original Message-----
From: Mateusz Loskot [mailto:mateusz at loskot.net] 
Sent: Monday, October 23, 2006 6:16 PM
To: dev at fdo.osgeo.org
Subject: Re: [fdo-dev] Enumerating connection properties

Romica Dascalescu wrote:
> Hi Mateusz,
> 
> MySQL: DataStore property is enumerable but you will be able to get
the
> values only if you are in pending state with the connection.
> If you are not connected to a server you can not take the schemas!

Romica,

Yes, I understand it. It's a two-step connection procedure.

Although, I think the ExerciseFdoConnection.cpp example from SDK's
DevGuideExample package is incorrect.

There is a function ExerciseFdoConnection::ConnectToProvider()
with following body:

////////////////////////////////////////////////////////////
connection = connectionManager->CreateConnection(providerInternalName);
connectionInfo = connection->GetConnectionInfo();
connectionPropertyDictionary =
connectionInfo->GetConnectionProperties();
retval = GetConnectionPropertyValues(connectionPropertyDictionary,
connectDialog);

if (retval == 0) {
   connectState = connection->Open();
   switch (connectState) {
   case FdoConnectionState_Busy: break;
   case FdoConnectionState_Closed: break;
   case FdoConnectionState_Open : break;
   case FdoConnectionState_Pending :
   retval = GetConnectionPropertyValues(connectionPropertyDictionary,
             connectDialog);
   if (retval == 0) {
      connectState = connection->Open();
   }
   break;

//...
}
////////////////////////////////////////////////////////////


As you see, the GetConnectionPropertyValues() function (member of
ExerciseFdoConnection class) is called first time *before* any
call of Open() step.

In the body of GetConnectionPropertyValues() I see:

////////////////////////////////////////////////////////////
if (IsEnumerable)
{
   // get the list of valid values
   EnumeratedValues = dictionary->EnumeratePropertyValues(propertyName,
numValues);
}
////////////////////////////////////////////////////////////

So, the result is as follows:
1. Call GetConnectionPropertyValues()
1.1. Call dictionary->EnumeratePropertyValues()
2. Call connection->Open()
2.1. Check connection state
2.2. Call connection->Open() again if needed

The step 1.1 is called before any call of Open(), so if there is any
enumerable property detected in the loop, how it's supposed to work?

Or may be this example is not up to date?

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe at fdo.osgeo.org
For additional commands, e-mail: dev-help at fdo.osgeo.org






More information about the Fdo-internals mailing list