Opened 20 years ago

Closed 20 years ago

Last modified 20 years ago

#536 closed defect (fixed)

SDE only supports SE_ROW_ID as index column

Reported by: hobu Owned by: sdlime
Priority: normal Milestone: 4.2 release
Component: MapServer C Library Version: 4.0
Severity: normal Keywords:
Cc:

Description

Build 4.01
Python Mapscript/Mapserver CGI

mapsde.c has a define that sets MS_SDE_ROW_ID_COLUMN to "SE_ROW_ID".  For many
layers, especially those that might have been created with ArcMap/ArcCatalog,
the index column is often named "OBJECTID"  

If mapsde.c can't find a column named SE_ROW_ID, it defaults to providing a
sequential index to the rows that it selects.  This is ok until you need to
query attributes out of the sde layer.  Then the indexes no longer match and the
errors that you get back can be deceiving. It is often SE_stream_fetch_row():
Shape or row not found. (-22)

It would be handy to have the ability to set the ROW_ID column on the connection
string, or have mapsde.c check for both SE_ROW_ID and OBJECTID as index columns.
 As such, this is probably a low priority bug, and a simple fix is to just
change the define to the index name (OBJECTID or SE_ROW_ID) to name that your
layers use.

Attachments (6)

sde_patch (8.2 KB ) - added by hobu 20 years ago.
Patch to add version suport to SDE and fix OBJECTID/SE_ROWID problem
sde_patch2 (8.9 KB ) - added by hobu 20 years ago.
Second patch to account for SE_INVALID_RELEASE
sde_patch3 (297 bytes ) - added by hobu 20 years ago.
There was a stale error not being reset
sde_patch4 (1.8 KB ) - added by hobu 20 years ago.
Traps around all calls to SE_stream_set_state
sde_patch5 (280 bytes ) - added by hobu 20 years ago.
Freeing something that didn't exist causes a crash
sde_patch6 (2.5 KB ) - added by hobu 20 years ago.
Patching to fix support for SDE for Coverages

Download all attachments as: .zip

Change History (21)

by hobu, 20 years ago

Attachment: sde_patch added

Patch to add version suport to SDE and fix OBJECTID/SE_ROWID problem

comment:1 by sdlime, 20 years ago

Status: newassigned
Howard: Iv'e got your patch and will apply tonite. Steve

comment:2 by sdlime, 20 years ago

Howard: I've not applied the patch yet so I'm still using a version with your 
first patch. It does not work with my setup (SDE 8.2). I get an error (-88) 
saying that the server does not support the operation, specifically mentioning 
the get_version_info function. I don't think your new patch addresses that 
anyway. Thoughts? We need backward compatability.

Steve

comment:3 by hobu, 20 years ago

Steve:

-88 appears to be related to having two different versions of ArcSDE in the mix.
 From the ArcSDE 8.3 Developer help:

SE_INVALID_RELEASE     (-88)
The release/version of the client application does not match the installed
release/version of the ArcSDE server, or the installed release/version of the
ArcSDE software does not match the release/version of the ArcSDE datasets. If
the datasets are older than the ArcSDE server, you can update them with the
admversion administration tool.

This thread discusses what might be going on:
http://forums.esri.com/Thread.asp?c=2&f=59&t=54439#136037

Also, SE_version_get_info is a function that has been in ArcSDE since the 3.x
days.  The versioned queries example in the docs has that function in it and its
copyright date is 1999.

I don't know what to do other than to put a macro in that shuts it off all
together.  Don't know if that would be acceptable.


comment:4 by sdlime, 20 years ago

This is true, I'm using an 8.2 client application to access an 8.3 database. 
However, this was not an issue before the first patch. Just need to understand 
why. It might be that if we see the -88 error that we shouldn't bail altogether.

comment:5 by sdlime, 20 years ago

I tried applying the patch and 2 sections failed. Can you confirm against 
what's in the CVS now and see if it works for you?

Steve

comment:6 by hobu, 20 years ago

I would speculate that how the 8.2 client software can't know how the version
tables in 8.3 are laid out, and expects to bail out when it sees that the
versions are different.  

If we get a -88 (client and server software aren't synced), they shouldn't
expect to be getting versioned queries, in my opinion. Should I trap for that
error? 

CVS version (4:30 CST pm today) works fine for me, but it doesn't appear that it
contains the patch that is attached to this bug report.  I can generate a new
patch against current CVS if you want.  This second patch completed version
support and added the stuff mentioned above.

comment:7 by sdlime, 20 years ago

I would hope that upgrading a server wouldn't automatically mean that every 
potential client should have to be recompiled. At least some backwards 
compatability makes sense. Perhaps the versioning is a departure point. Let's 
try trapping that particular error. Is there a way we can proceed with a non-
versioned query in this case?

Steve

comment:8 by sdlime, 20 years ago

Please make a second patch...

by hobu, 20 years ago

Attachment: sde_patch2 added

Second patch to account for SE_INVALID_RELEASE

by hobu, 20 years ago

Attachment: sde_patch3 added

There was a stale error not being reset

comment:9 by sdlime, 20 years ago

Progress, but still an error.

msSDELayerOpen(): SDE error. SE_stream_set_state(): This SDE server does not 
support this client or operation. (-88) 

Steve

comment:10 by sdlime, 20 years ago

BTW I committed that last patch...

by hobu, 20 years ago

Attachment: sde_patch4 added

Traps around all calls to SE_stream_set_state

by hobu, 20 years ago

Attachment: sde_patch5 added

Freeing something that didn't exist causes a crash

comment:11 by dmorissette, 20 years ago

Cc: morissette@… added

comment:12 by dmorissette, 20 years ago

Milestone: 4.2 release
Let's see if we can close this one for the 4.2 release

comment:13 by sdlime, 20 years ago

Howard is dealing with one last issue related to SDE for coverages. Should be 
ready for 4.2 otherwise.

by hobu, 20 years ago

Attachment: sde_patch6 added

Patching to fix support for SDE for Coverages

comment:14 by sdlime, 20 years ago

Resolution: fixed
Status: assignedclosed
This seems to be OK now. I'm changing the resolution to fixed. Thanks for all 
the hard work Howard!

comment:15 by hobu, 20 years ago

blocked: 834
Note: See TracTickets for help on using tickets.