[fdo-internals] TIcket 471: ArcSDE Long Text Fields.. testing patch

Romica Dascalescu Romica.Dascalescu at autodesk.com
Mon Mar 9 10:48:37 EDT 2009


Hi Chris,

I have a few comments about your change, see below.

1) ArcSDE/Src/Provider/ArcSDEDescribeSchemaCommand.cpp

You should use the value from capabilities when we set length ("data_definition->SetLength(2147483647);")
See below the capabilities reported by the provider:

FdoInt64 ArcSDESchemaCapabilities::GetMaximumDataValueLength (FdoDataType dataType)
{
    switch (dataType)
    {
        case FdoDataType_String:   return (FdoInt64)4294967296LL; // ArcSDE's limit itself
        case FdoDataType_BLOB:     return (FdoInt64)4294967296LL; // Oracle's limit, which is higher than SQL Server's limit
        case FdoDataType_CLOB:     return (FdoInt64)4294967296LL; // Oracle's limit, which is higher than SQL Server's limit
    }
    return (FdoInt64)-1;
}

2) ArcSDE\Src\Provider\ArcSDEReader.cpp

Note: FDO keeps length in bytes, SDE expects length in characters (bytes/wchar_t depending of the type of the CLOB and SDE_UNICODE).

Mixing SE_NCLOB_TYPE with SE_CLOB_TYPE will create problems when SDE_UNICODE is not defined (when we use 9.1).
SE_NCLOB_INFO - contains wchar_t* characters and length is provided in wchar_t and not in bytes
Either you add support for CLOB only for 9.2 and not for 9.1 (add the new code with #ifdef SDE_UNICODE) or you fix the issue (in ArcSDEReader::GetLOBStreamReader).
You need to fix ArcSDEReader::GetLOBStreamReader and ArcSDEReader::GetLOB since the size of the buffer is not blob_length it is sizeof(CHAR)*blob_length.
FdoLOBValue and ArcSDEBLOBStreamReader expects byte* and length (in bytes), we provide (byte*)(wchar_t*) and length (in wchar_t) and we lose half of the array.

ArcSDEReader::GetLOB you allocate twice a FdoByteArray could you please change the code and depending of the conditions allocate it only once?


3) ArcSDE\Src\Provider\ArcSDEFeatureCommand.h

Could you please tell why you replaced
"ret = SE_stream_set_string (stream, columnIndex, NULL);"
with
"ret = SDENAME_C(SE_stream_set_string) (stream, columnIndex, NULL);"?

Naming of function should be handled by define of SDE_UNICODE.

case FdoDataType_CLOB: // Character Large Object
No conversion should be done here. The client of the CLOB should update the right values in CLOB and you just need to call the right function with the buffer and right length.
Note: FDO keeps length in bytes, SDE expects length in characters (bytes/wchar_t depending of the type of the CLOB and SDE_UNICODE).

Thanks,
Romi.

________________________________
From: fdo-internals-bounces at lists.osgeo.org [fdo-internals-bounces at lists.osgeo.org] On Behalf Of Chris Erickson [chris at cartopac.com]
Sent: Friday, March 06, 2009 5:12 PM
To: FDO Internals Mail List
Subject: [fdo-internals] TIcket 471: ArcSDE Long Text Fields.. testing patch

I’m not done testing this patch, but if anyone would like to take a look at or review it, I’d appreciate it.

I’ve not tested getting streams on large text fields yet.

It contains the following fixes:
Support for CLOB/NCLOB fields.
Allocating string fields for conversion on heap.

There are known errors with SQL Server VARCHAR(MAX)/NVARCHAR(MAX) fields, where they are coming out empty for some reason.  I have no clues on this, if anyone else wants to look.

I’ve not been able to fully test against Oracle either, nor complie against 9.1.

[cid:image001.png at 01C99E6D.EE56CE60]<http://www.cartopac.com/>

chris erickson
developer
chris at cartopac.com<mailto:chris at cartopac.com>
970.493.9500 x 191
970.482.1485 (fax)



-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 7232 bytes
Desc: image001.png
Url : http://lists.osgeo.org/pipermail/fdo-internals/attachments/20090309/1034b260/image001.png


More information about the fdo-internals mailing list