No edit session in the Progress

Source: Internet
Author: User

Runtime Environment: Development Environment: 64bit, visualstudio2008 with SP1, arcengine10.0, netframework4.0, iis7, and C # development languages for Windows 7 flagship edition.

Problem description: When debugging the WebService compiled by AE, the error "No edit session in the Progress" occurs during network flow direction initialization (sometimes the error "this project cannot be found in this collection" is prompted, the two can be processed in the same way ).

When this error is detected, it is considered that the editing function is not enabled, but my editing is enabled. The isbeingedited () method is used to determine the editing status.

I seldom thought about error information on the Internet. I have read the following information:

1. The editing status is not enabled. (This rule is excluded after passing the check)

2. The workspace that enables editing does not contain the elements to be edited, that is, the inconsistency of the editing space. (After checking the edited network and all the data that constitute the network are under the same dataset and the editing status of the dataset is enabled, the two are consistent in the editing space, so this is also excluded)

3. This problem may occur when advanced editing is used. You can use it after deleting the network. (The network is used, and the network cannot be deleted !!! This is also excluded)

I thought that I had been working on the CS project before and wrote the WebService for the first time. Do I think this is because of problems caused by WebService? So I set up a CS project testing program, the same problem still occurs.

Is it a network problem? Therefore, in the same code, I changed the network flow direction initialization code to the most basic element to edit the code (simple attribute assignment). The result is the same, but the error message is changed:

Objects in this class cannot be updated outside an edit session

I checked the solution for this error on the Internet. Some of the solutions are the same as those for previous errors (three listed above), but there are several other solutions:

3.

4. Check whether the geoedit permission of ArcGIS Engine is set for the license file of ArcGIS Engine.

5. Check whether the version is registered. (Check is correct)

6. check whether there are layers related to the layer in the database, such as the topological relationship and the linked note layer. These layers occupy the editing layers and an error occurs. (It should be okay to enable overall editing when all my data is together)

I focused on article 4, so the code for permission initialization was not supported before editing. Later, I checked the license initialization and knew that the initialization was required during the program initialization. Therefore, I transplanted the code to the program initialization and ran the program again. The problem was solved!

The following is the program license initialization code:

   1: ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop);
   2: AoInitialize aoi = new AoInitializeClass();
   3: esriLicenseProductCode productCode = esriLicenseProductCode.esriLicenseProductCodeEngineGeoDB;
   4: if (aoi.IsProductCodeAvailable(productCode) == esriLicenseStatus.esriLicenseAvailable)
   5: {
   6:     aoi.IsProductCodeAvailable(productCode);
   7:     if (aoi.Initialize(productCode) != ESRI.ArcGIS.esriSystem.esriLicenseStatus.esriLicenseCheckedOut)
8: aoinimsg = ", please check the gdbedit permission in arcengine! ";
   9: }
  10: else
11: aoinimsg = ", please check the gdbedit permission in arcengine! ";

 

It took me two or three days to solve the problem. It was really troublesome. However, this problem occurred again later during the WebService deployment because the initialization failed, it is estimated that it is related to the server where the program lock is deployed (but there is no problem in checking the desktop and AE licenses on the server). It is a good time (another day ), later, I did not know how to restart ArcGIS and IIS services. I hope the comrades who wish to know the reason will tell me that I would like to thank you first!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.