MCPcopy Index your code
hub / github.com/MapServer/MapServer / msOracleSpatialLayerClose

Function msOracleSpatialLayerClose

maporaclespatial.c:1865–1921  ·  view source on GitHub ↗

closes the layer, disconnecting from db if connected. layer->layerinfo is freed */

Source from the content-addressed store, hash-verified

1863
1864/* closes the layer, disconnecting from db if connected. layer->layerinfo is freed */
1865int msOracleSpatialLayerClose( layerObj *layer )
1866{
1867 msOracleSpatialLayerInfo *layerinfo = (msOracleSpatialLayerInfo *)layer->layerinfo;
1868 /*int lIntSuccessFree = 0;*/
1869
1870 if (layer->debug)
1871 msDebug("msOracleSpatialLayerClose was called. Layer: %p, Layer name: %s. Layer connection: %s\n", layer, layer->name, layer->connection);
1872
1873 if (layerinfo != NULL)
1874 {
1875
1876 /*
1877 * Some errors with the OCIObjectFree with query function
1878 * If uncomment draw mode will work but no query modes
1879 * Need to investigate the error cause
1880 */
1881 /*lIntSuccessFree = TRY (layerinfo->orahandlers, OCIObjectFree(layerinfo->orahandlers->envhp, layerinfo->orahandlers->errhp, (dvoid *)layerinfo->obj, (ub2)OCI_OBJECTFREE_FORCE));
1882 *if (!lIntSuccessFree)
1883 * msDebug("Error: %s\n", layerinfo->orahandlers->last_oci_error);
1884 */
1885 /* Release Statement Handles */
1886 if (layerinfo->orastmt != NULL)
1887 {
1888 msOCIFinishStatement(layerinfo->orastmt);
1889 layerinfo->orastmt = NULL;
1890 }
1891 if (layerinfo->orastmt2 != NULL)
1892 {
1893 msOCIFinishStatement(layerinfo->orastmt2);
1894 layerinfo->orastmt2 = NULL;
1895 }
1896
1897 /* Release Datahandlers */
1898 if (layer->debug)
1899 msDebug("msOracleSpatialLayerClose. Cleaning layerinfo handlers.\n");
1900 msOCICloseDataHandlers( layerinfo->oradatahandlers );
1901 layerinfo->oradatahandlers = NULL;
1902
1903 /* Free the OCI cache only if there is no more layer that could use it */
1904 layerinfo->orahandlers->ref_count--;
1905 if (layerinfo->orahandlers->ref_count == 0)
1906 OCICacheFree (layerinfo->orahandlers->envhp, layerinfo->orahandlers->errhp, layerinfo->orahandlers->svchp);
1907
1908 /* Release Mapserver Pool */
1909 if (layer->debug)
1910 msDebug("msOracleSpatialLayerClose. Release the Oracle Pool.\n");
1911 msConnPoolRelease( layer, layerinfo->orahandlers );
1912
1913 /* Release Layerinfo */
1914 layerinfo->orahandlers = NULL;
1915
1916 msOCIClearLayerInfo( layerinfo );
1917 layer->layerinfo = NULL;
1918 }
1919
1920 return MS_SUCCESS;
1921}
1922

Callers

nothing calls this directly

Calls 6

msDebugFunction · 0.85
msOCIFinishStatementFunction · 0.85
msOCICloseDataHandlersFunction · 0.85
msConnPoolReleaseFunction · 0.85
msOCIClearLayerInfoFunction · 0.85
msSetErrorFunction · 0.85

Tested by

no test coverage detected