Newbie: how to dynamically add layer from oracle

600
5
07-02-2012 07:13 AM
steveevans
New Contributor
Total newbie here.

    I have an asp .net (web) application that dynamically creates a new oracle table during a users session (table name is radomly generated).
   
    This table has 3 columns: UniqueId, X_coord, Y_coord.
   
    I need to change this app so that it can plot these points on a map

    What is the best way of doing this within the javascript api (presuming javascript api is the way to go).

    BTW, we have arcgis 10.1 server and desktop.

    Thanks a whole lot in advance.

    Steve
0 Kudos
5 Replies
derekswingley1
Frequent Contributor
You'll need to publish your table via ArcGIS Server to use it in a JavaScript API app. Since your table is generated per user session, I don't think there's a clean way to do this. Could you modify your architecture to always have a single table that has a user_id column and then filter records from the table based on a user_id? You could then have a process that periodically cleans up your table so it doesn't grow indefinitely.

Alternatively, if you know the name of the per-session table, and it's published as a web service, you could use esri.request to send a request to your web service to get your points.
0 Kudos
steveevans
New Contributor
swingley,

yes i could easily use a single table.

disadvatages with this approach (although not show stoppers):

- It will grow over time and will need some kind of maint (like purge entries > 2 days old).

- It will also become terribly fragmented which may affect performance

- there may be lock contention issues during insert/delete activity

i can get around all of the above issues with some engineering and will do this if there is no other way that's less complicated.

thank you a whole lot for your advice - i really was at a loss on how to proceed.

if anyone else has any ideas please share.

steve
0 Kudos
JohnnyPenet
New Contributor
Steve,

I think the simplest solution is having a rest service that returns your points based on the user session id. Once you get the points, create a graphic layer and add these point to the layer, so they will always be at the top of the map with a symbol you defined.
The only thing to look after is the spatial reference, if the points are the same as the base layer, no transform is needed, if not it could be that you will need a transform using the project method of the geometry service of your ArcGis server.

Johnny
0 Kudos
steveevans
New Contributor
Steve,

I think the simplest solution is having a rest service that returns your points based on the user session id. Once you get the points, create a graphic layer and add these point to the layer, so they will always be at the top of the map with a symbol you defined.
The only thing to look after is the spatial reference, if the points are the same as the base layer, no transform is needed, if not it could be that you will need a transform using the project method of the geometry service of your ArcGis server.

Johnny


Johnny,

is this the same as one of swingleys prev suggestions where he said:
Alternatively, if you know the name of the per-session table, and it's published as a web service, you could use esri.request to send a request to your web service to get your points.


or is this something quite different?

thanks,

steve
0 Kudos
JohnnyPenet
New Contributor
Steve

Indeed, the same as swingleys . This is the solution i prefer. Putting it all into one table could result in a less stable situation (locks !!!)  and difficult to simulate (large) multi user access.

Johnny
0 Kudos