Showing posts with label Oracle. Show all posts
Showing posts with label Oracle. Show all posts

Tuesday, May 1, 2012

Polyline wrong coordinates

We have been developing for a long time on a single oracle DB Server (Development stage) and recently added a new integration server. Because of time constraints we decided to just copy the data from the Dev server using SQL (out DBA did that part), and since we moved to SDO_GEOMETRY the data can be transferred without the use of ArcDesktop utilities.

So the data was moved correctly and the registration went without a glitch. But when we tried to create a new line in the layer its coordinates moved from (35.5, 32.7) (in x,y) to (–324.4, 32.7). The first thing I checked was my code but there were no changes done and in the old environment everything worked fine.

Looking at the Layers table in the SDE schema that table looked like:

EFLAGS

LAYER_MASK

GSIZE1

GSIZE2

GSIZE3

MINX

MINY

MAXX

MAXY

LAYER_CONFIG

138674317

128

-2

0 0

-400

-400

471.3916

471.3916

SDO_GEOMETRY

My first thought was that the –400 somehow affected the data being inserted but the same values were in the old DB and they worked.

After many actions of unregister and register of that layer the problem was solved.

 

TODO: Add table border, it looks bad in the site

Tuesday, March 6, 2012

Bug: Using TimeStamp with Time Zone in (Oracle) Entity Framework

For the past week I have been working on the problem of correctly saving TimeStamp with Time Zone in (Oracle) Entity Framework. The problem is both DateTime and OffsetDateTime when saved in that field in the DB are missing a critical info – the location offset given to them. They always save the field with the offset of the client, in my case +02:00.

In the beginning I was sure it was something that will be easily fixed, simply because I came through this StackOverFlow question/answer which talked about changing the numeric data type so that bool is number(1,0). So I was sure it was a generic interface, well its not!

Looking into Oracle’s EFOracleProviderServices decompiled source (using JetBrains’s dotPeek) I tried looking for config values but instead found the bug in Oracle:

  1. new OracleParameter(name, (object) ((DateTimeOffset) value).DateTime))

Meaning that although you might have gone into the trouble of creating a DateTimeOffset (with no trouble at all), Oracle just knows what’s best and will convert it to DateTime (plus enable a boolean that will later convert it back to offset).

I have tried using Open Source Providers but so far no luck (had problem finding the provider or it wasn’t in .net 4.0), I will try again tomorrow.

http://eforacleodpprovider.codeplex.com

http://archive.msdn.microsoft.com/EFOracleProvider/Release/ProjectReleases.aspx?ReleaseId=1395

//TODO: Continue this

 

Resources:

StackOverFlow: Where do I put Oracle EntityFramework Mapping settings for LinqPad?

Tuesday, February 14, 2012

Oracle arcSde view small integer bug

I am writing this here just as a reminder.

ArcSde with Oracle (11g  maybe all) has a bug where when you create a Feature layer with a small integer column and then create a view out of that table, the view will now have the column as integer.

I have not found a solution for this, except rewriting the code…

 

You can see it in ArcGis Server:

For SQL Server 2008 table: Type: esriFieldTypeSmallInteger

For Oracle 11g view: Type: esriFieldTypeInteger