Select to view content in your preferred language

editing a version of a Geodatabase through SQL from multiple sessions

3219
3
Jump to solution
08-14-2015 10:14 AM
VishUma
Deactivated User

Hi all,

I am trying to edit a FeatureClass in a specific version of the GeoDatabase through SQL using versioned views. I call edit_version and send in the version name and "1" to start editing from one connection to the database. I open another connection to the database and call edit_version with the version name and "1", which ends up returning the following error

Msg 50000, Level 16, State 1, Procedure edit_version, Line 208

Lock conflict detected for state 26

Does this mean that a version can only be edited from one session at a time? Is this a limitation of editing geodatabases through SQL? This means that geodatabase versions cannot be edited by web applications. Since ArcMAP allows two users to edit the same version, does it mean that it is not a limitation if using the ArcObjects SDK?

Thank You,

Vish

0 Kudos
1 Solution

Accepted Solutions
JoshuaBixby
MVP Esteemed Contributor

Sometimes the most important notes in documentation aren't where you expect them.  If you look at the Edit versioned data in SQL Server using SQL, specifically the Edit a named version section, the Purpose description for the create_version stored procedure states:  If you are editing named versions (versions other than Default), always edit your own, separate version; multiple editors cannot edit the same named version using versioned views.  It is for this reason the workflow described in the documentation shows creating a new version first.  Apparently, this isn't the case for the Default version, but I haven't tested it directly.

View solution in original post

3 Replies
George_Thompson
Esri Notable Contributor

Sounds like you are not editing the correct version and the state. Make sure that you start the edit session pointing to the correct version.

Here is the documentation for Oracle at 10.3, but all the other RDBMS versions are listed on this page also.

Edit versioned data in Oracle using SQL—Help | ArcGIS for Desktop

An overview of editing versioned data using SQL—Help | ArcGIS for Desktop

Hope this helps

-George

--- George T.
0 Kudos
VishUma
Deactivated User

I think I am editing the correct version. I have a version named "qa". I am using MS SQL Server. So, I open up two instances of sql server management studio to create 2 connections to the database and execute the same command "edit_version 'qa', 1" in both the connections. The first one works and the second one throws the error mentioned above

Thank You,

Vish

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

Sometimes the most important notes in documentation aren't where you expect them.  If you look at the Edit versioned data in SQL Server using SQL, specifically the Edit a named version section, the Purpose description for the create_version stored procedure states:  If you are editing named versions (versions other than Default), always edit your own, separate version; multiple editors cannot edit the same named version using versioned views.  It is for this reason the workflow described in the documentation shows creating a new version first.  Apparently, this isn't the case for the Default version, but I haven't tested it directly.