[mapguide-trac] #744: ERROR: Please try your operation later as the resource was busy

MapGuide Open Source trac_mapguide at osgeo.org
Wed Oct 29 11:29:06 EDT 2008


#744: ERROR: Please try your operation later as the resource was busy
-------------------------------+--------------------------------------------
   Reporter:  ssalari          |       Owner:                                  
       Type:  defect           |      Status:  new                             
   Priority:  medium           |   Milestone:  2.1                             
  Component:  Feature Service  |     Version:  2.0.2                           
   Severity:  trivial          |    Keywords:  FeatureSource, resource was busy
External_id:                   |  
-------------------------------+--------------------------------------------
 Hi,

 I use the following code at first step:

 {{{
 private void rollSelectedVertex(boolean forward, int fromIndex) throws
 MgException{
         int roll = (forward)?1:-1;
         String selectionXML =null;

         int count = -1;
         int rolledIndex = fromIndex+roll;
         MgSelection selection = new MgSelection();


         boolean isCyclicElement = false;
         MgFeatureReader getShapeVertexReader =
 featureService.SelectFeatures(showShapeIdentifier,
 showShapeIdentifier.GetName(), new MgFeatureQueryOptions());
         if(getShapeVertexReader.ReadNext()){
             String wkt =
 (String)valueStrategy.getPropertyValueFromReader(getShapeVertexReader,VertexManagerConfig.ShowShapeProperty.GEOM.GetName());
             isCyclicElement = (wkt.indexOf("POLYGON")!=-1);
         }
         SupportGWOS.ReleaseReader(getShapeVertexReader);


         MgFeatureReader moveSelectionVertexReaderCount =
 featureService.SelectFeatures (vertexIdentifier,
 layerBase.GetFeatureClassName(), new MgFeatureQueryOptions());
         while(moveSelectionVertexReaderCount.ReadNext()){
             count++;
         }
         SupportGWOS.ReleaseReader(moveSelectionVertexReaderCount);



         if((fromIndex+roll)>count){
             rolledIndex=0;
         } else if((fromIndex+roll)==count && isCyclicElement){
             rolledIndex = (forward)?1:count-1;
         } else if((fromIndex+roll)<0){
             rolledIndex = (isCyclicElement)?count-1:count;
         }
 ------------------------MAY BE CAUSE OF ERROR
 ------------------------------------
         MgFeatureQueryOptions queryOptions = new MgFeatureQueryOptions();
 queryOptions.SetFilter(VertexManagerConfig.VertexProperty.ORDER_INDEX.GetName()+"
 = "+rolledIndex);
         MgFeatureReader moveSelectionVertexReaderNextTry =
 featureService.SelectFeatures (vertexIdentifier,
 layerBase.GetFeatureClassName(), queryOptions);
         SupportGWOS.ReleaseReader(moveSelectionVertexReaderNextTry);
     //CAUSE OF 'Please try your operation later as the resource was busy'
 selection.AddFeatures
         selection.AddFeatures(layerBase, moveSelectionVertexReaderNextTry,
 0);

         selectionXML = selection.ToXml();
 -----------------------END-OF MAY BE CAUSE OF ERROR
 --------------------------------

         vertexManagerForm.formConfig.saveMap();
         vertexManagerForm.setSelectionXML(selectionXML);
     }
 }}}

 then at the next request I execute the following function with the same
 arguments of previus request.

 ClearDataSource(featureService, vertexIdentifier,
 vertexIdentifier.GetName());


 {{{
 public static void ClearDataSource(MgFeatureService featureSrvc,
 MgResourceIdentifier dataSourceId, String featureName)  throws MgException
     {
         MgDeleteFeatures deleteCmd = new MgDeleteFeatures(featureName, "ID
 >= 0");
         MgFeatureCommandCollection commands = new
 MgFeatureCommandCollection();
         commands.Add(deleteCmd);
         featureSrvc.UpdateFeatures(dataSourceId, commands, false);
     }
 }}}

 and obtain the following error:

 {{{
 Please try your operation later as the resource was busy: Session:
 18630e58-0000-1000-8000-
 00c09f25bfe0_en_C0A800C60AFC0AFB0AFA//VertexPropertyFeature.FeatureSource
 org.osgeo.mapguide.MgResourceBusyException: Please try your operation
 later as the resource was busy: Session:18630e58-0000-1000-8000-
 00c09f25bfe0_en_C0A800C60AFC0AFB0AFA//VertexPropertyFeature.FeatureSource
     at
 org.osgeo.mapguide.MapGuideJavaApiJNI.MgFeatureService_UpdateFeatures(Native
 Method)
     at
 org.osgeo.mapguide.MgFeatureService.UpdateFeatures(MgFeatureService.java:98)
     at
 it.escsolution.gwos.util.SupportGWOS.ClearDataSource(SupportGWOS.java:153)
     at
 it.escsolution.gwos.struts.action.VertexManagerAction.clearVertexes(VertexManagerAction.java:69)
 }}}

 How can I close the feature reader without obtain the error on next
 request?

 Thanks.

-- 
Ticket URL: <http://trac.osgeo.org/mapguide/ticket/744>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list