SDE10 upgrade issues.

922
6
08-01-2011 12:31 PM
StacyJohnson
New Contributor
We recently upgraded from SDE9.3 to SDE10, since then we have been having issues when using the function SE_stream_set_spatial_constraints.  We are getting a return value of 4294967266, which falls outside of the range of error number in the sdeerrno.h file. 

This call has worked fine in the past for sde 8.3 through sde9.3.  The application compiles fine but when running the function SE_stream_set_spatial_constraints returns 4294967266.  The applications and all libraries, including sde10, are 64bit and we are using rhel5. SDE is installed in an Oracle 11g database.

Any help would be appreciated.

Here is a code snippet from our function at the failure point.

   long rc;
   ....
   strcpy(Filter.table, "OPERATIONS");
   strcpy(Filter.column, "sde_cov");
   Filter.filter.shape = tgt_shape;
   Filter.method = SM_AI;  /* area intersection */
   Filter.truth = TRUE;
   Filter.filter_type = SE_SHAPE_FILTER;

   rc = SE_stream_set_spatial_constraints(stream, SE_ATTRIBUTE_FIRST, FALSE,1,&Filter);
   if(rc != SE_SUCCESS)
   {
      printf("Unable to filter with intersecting shape: Error code: %ld\n",rc); 
      SE_shape_free (tgt_shape);
      SE_sql_construct_free(sqlc);
      SE_connection_free(Connection);
      SE_stream_free(stream);
      SE_coordref_free(coordref);
      return 0;
   }
  ......
0 Kudos
6 Replies
VinceAngelo
Esri Esteemed Contributor
It's not possible for any ArcSDE function to return a value in excess of 2^31-1. If you defined
the 'rc' variable as LONG (which on 64-bit platforms is defined "int"), the return value would
have been -30 (SE_INVALID_SEARCH_METHOD).

Did you just recently port to 64-bit? What compilation flags do you use? Is '-DSDE64' in
the list? Alignment issues could easily cause this sort of problem, but usually the compiler
would complain when the prototypes are violated.

-V

BTW:  The SE_stream_query() function was superceeded by SE_stream_query_with_info at
the 9.2 release.  If you're still using SE_SQL_CONSTRUCT-based functions at 10.0, you may
run into other difficulties as well.
0 Kudos
StacyJohnson
New Contributor
V thanks for the response.

The flags we use are CFLAGS=-g -DLINUX

We have been using RHEL5 64bit for several years but sde10 was the first 64bit version of sde for RHEL5.  Previously we have used 32bit sde9.3 and sde9.1 before that and compiled our programs 32bit. We had been using sde9.3 for at least two years and the code worked fine.  Since we were able to get a 64bit version, we removed -m32 flag and let the programs compile at 64bit.

I don't see anything in the sdetype.h file or other files that mentions that SE_stream_query has been deprecated and shouldn't be used.  In the past we just change out the library and include calls in our makefiles and then recompile and didn't have issues.
0 Kudos
StacyJohnson
New Contributor
V

Thanks a million the -DSDE64 flag allows the programs to run correctly.
0 Kudos
VinceAngelo
Esri Esteemed Contributor
I build 64-bit apps on RHEL 5 using the 9.3.1 SDK all the time. I'm somewhat amazed you've
gotten a successful compile with any SDK without using the required flags (especially -Dunix).

On 32-bit hosts my CFLAGS is:
 
-Wall -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_ISOC99_SOURCE -DARCSDE=100 -DLINUX -Dunix -I$(SDEHOME)/include


On 64-bit Linux I use:
 
-Wall -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED -D_ISOC99_SOURCE -DARCSDE=100 -DLINUX -DSDE64 -Dunix -I$(SDEHOME)/include

(only the "-Wall" and "-DARCSDE=100" are my own preferences)

For both environments, I also need:
 
CC= gcc
LFLAGS=-L$(SDEHOME)/lib
LIBS=-lsde -lsg -lpe -lpthread -lm -ldl


- V
0 Kudos
SeanSmyth
New Contributor
It's not possible for any ArcSDE function to return a value in excess of 2^31-1. If you defined
the 'rc' variable as LONG (which on 64-bit platforms is defined "int"), the return value would
have been -30 (SE_INVALID_SEARCH_METHOD).

Did you just recently port to 64-bit? What compilation flags do you use? Is '-DSDE64' in
the list? Alignment issues could easily cause this sort of problem, but usually the compiler
would complain when the prototypes are violated.

-V

BTW:  The SE_stream_query() function was superceeded by SE_stream_query_with_info at
the 9.2 release.  If you're still using SE_SQL_CONSTRUCT-based functions at 10.0, you may
run into other difficulties as well.




Hi Vince,

Do you have a list of superceeded functions within the c  - api @ version 10.  I am finding that we are getting memory management issues with the use of

SE_stream_create

SE_sql_construct_alloc

SE_stream_query
SE_stream_set_spatial_constraints

Any info would be appreciated


Cheers

Sean
0 Kudos
VinceAngelo
Esri Esteemed Contributor
SE_stream_query is the only one I can think of.  You can review sdetypes.h for comments.

I always found SE_sql_construct_alloc to be a waste as a helper function (I try to avoid mallocing
small structures), so I never needed to replace it when SE_QUERYINFO came out.

The ArcSDE 'C' API is sufficiently mature that memory management issues are more likely a developer
issue than a library one.  You'd have to post your source for help with memory corruption.

- V
0 Kudos