You are here: > ESRI Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

ArcGIS Desktop - General Concepts forum

How to maintain the Unique ID other than "O...   German Cheung Jan 23, 2002
Re: How to maintain the Unique ID other tha...   Jodi Luostarinen Mar 30, 2004
Re: How to maintain the Unique ID other tha...   Allan Benvin Sep 14, 2004
Re: How to maintain the Unique ID other tha...   Eileen Frimberger Nov 20, 2006
Re: How to maintain the Unique ID other tha...   Sri Tula Jan 18, 2007
Re: How to maintain the Unique ID other tha...   Allan Benvin Mar 06, 2007
Re: How to maintain the Unique ID other tha...   Joe Borgione Mar 07, 2007
Re: How to maintain the Unique ID other tha...   Jason Clemis Nov 29, 2007
Re: How to maintain the Unique ID other tha...   Jessica Parteno Dec 03, 2007
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject How to maintain the Unique ID other than "OBJECTID" for Editing in Versioned Geodatabase 
Author German Cheung 
Date Jan 23, 2002 
Message Dear all

For multiuser editing, we would like to generate a unique id for the every new features. Say the rule is the maximum of the unique id (Other than ObjectID field plus one.

If we use IQueryDef object to get the MAX number, what will be the version that we are refering to? Pre-Editing Version, My Own Edit Session now or just the parent version?

Since SDE have versioning capability. If two or more editor users generate Unique ID at the same time in their edit session. Will they get the same number from IQueryDef?

Any workflow you can suggest to me?

I have some idea,I can leave the Unique Id generation to the Save Edit moment.

If we reconcile to the parent version when save edits, use IDifferenceCursor Object to find the Insert Feature and generate ID from their with a loop. It seems to me that it will be a way to achieve my requirement, however, any one have comments on the above or recommendation to me?

Thank you very much!

 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: How to maintain the Unique ID other than "OBJECTID" for Editing in Versioned Geodatabase 
Author Jodi Luostarinen 
Date Mar 30, 2004 
Message Hello,

I am using a versioned geodatabase (SQLServer 2000) and would like to maintain a user defined facilityID field as the unique key because I am finding that the ObjectID sometimes changes.

Did you find a solution to this problem?

Thanks,
Jodi 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: How to maintain the Unique ID other than "OBJECTID" for Editing in Versioned Geodatabase 
Author Allan Benvin 
Date Sep 14, 2004 
Message We are maintaining our own unique IDs in a versioned geodatabase by using an Oracle Sequence. Triggers don't work for the versioned data but you can trap the creation of the feature using either:
1)FeatureClassExtension (IObjectClassEvents)
2)ArcMap Extension (IExtension)

We are using an ArcMap extension, in the extension class we trap the editor events by declaring "Public WithEvents M_aoEditEvents As esriCore.Editor" at the start of the extension class. This gives you access to the OnCreateFeatureEvent. In this event you can determine the featureclass being edited and if it is the one you want to track you can get the next ID from the Oracle Sequence.

You may end up with gaps in your ID values if people do not post their version but at least the numbers will be unique. As long as the extension is enabled this OnCreateFeature event will be trapped.

If you use a FeatureClassExtension everyone who wants to edit or view the data must have the dll on their machine.
 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: How to maintain the Unique ID other than "OBJECTID" for Editing in Versioned Geodatabase 
Author Eileen Frimberger 
Date Nov 20, 2006 
Message I am trying to do exactly the same thing you are and having much difficulty. I struggle with these class extensions on how to implement them. Would you mind posting your General Declarations and the Initialization sections of your code? I'm hoping this will help me figure out how this should all be set up.
Many thanks!
Eileen 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: How to maintain the Unique ID other than "OBJECTID" for Editing in Versioned Geodatabase 
Author Sri Tula 
Date Jan 18, 2007 
Message Allan,

You said triggers do not work with versioned data. What version of SDE were you using? We are currently using arcsde 9.1, and oracle 9i. We are trying to generate a new unique id everytime an editor inserts/modifies a feature segment independent from the object id. We already have created a sequence and used a trigger to the A table in Oracle so that it will create new unique id everytime we insert/modify the feature. It seems to work and does what we need it to do. But the problem is, if there are more than one versions off the parent version, and they both are making edits, when the parent version reconciles, it also updates the id which is causing conflicts due to the change in the state_id.
Is there anyway we could stop to update the id when we reconcile parent version. Any help/suggestions would be appreciated.

Thanks for help in advance.

Sri 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: How to maintain the Unique ID other than "OBJECTID" for Editing in Versioned Geodatabase 
Author Allan Benvin 
Date Mar 06, 2007 
Message Yes, technically you can use triggers but you will get the problem that you are currently encountering with conflicts. Another problem is that if the data gets unregistered as versioned for any reason your triggers will be invalidated as the A and D tables will be recreated with new names (ie: A843 instead of A785). Our data gets unversioned once a year or so if we really need to clean up the state tree.

You will probably always get the conflict if there are multiple versions being edited, if the people are editing the same features.

We have an updated Editor Extension to get around the issue of deploying featureclass extensions. We listen for the OnCreate and OnModify events and update either a CREATE_ID or a REVISION_ID column depending on the action. Both columns are defined as GUID, so theoretically we will never have duplicate values and we don't need a sequence in the database. The nice thing about the GUID is if we do some disconnected editing, we can create new GUIDs and don't have to worry about synching them up with the sequence when we get back to the office. The GUID values aren't sequential but we don't care about that, we just want them to be unique.
-Al 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: How to maintain the Unique ID other than "OBJECTID" for Editing in Versioned Geodatabase 
Author Joe Borgione 
Date Mar 07, 2007 
Message In 9.2 ArcSDE you can replicate your data base and in doing so, it generates a GUID. They are ugly, but they work. 
  Joe Borgione
AlpineGeographic  
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: How to maintain the Unique ID other than "OBJECTID" for Editing in Versioned Geodatabase 
Author Jason Clemis 
Date Nov 29, 2007 
Message With the Global ID's can they be used in a relationship class ? I have tried and have not had any success. I have been wrestling with the issue of unique ID's and have a server trigger that works off of the A table. But I would like something cleaner if possible. I don't want to have to extend my feature class with code since I will have to put the dll on any other client using that information 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: How to maintain the Unique ID other than "OBJECTID" for Editing in Versioned Geodatabase 
Author Jessica Parteno 
Date Dec 03, 2007 
Message Hi Jason,

In order to use a Global ID field in a relationship class, the other key has to be a GUID field. A relationship cannot be created between two Global ID fields because both of the Global ID fields will have unique non-editable values that are generated by the GDB.

GUID fields store registry style strings like Global ID fields, however you can control their content. So you can use a Global ID field and a GUID field to create a relationship class, by populating the GUID field with the matching Global ID field's registry key values.

Hope this helps, 
  Jessica Parteno
ESRI