<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 28, 2021 at 9:38 AM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div>
    <p>We could have a OSRSetAutoclosePROJDatabase() global function
      that would call proj_context_set_autoclose_database() when it
      creates the per-thread PROJ context<br>
    </p>
    <p>==> ogr/ogr_proj_p.cpp</p>
    <p>An alternative would be to enhance PROJ to have a mode where the
      SQLite3 db handle would be shared amongst several contexts. In
      theory that could be possible as you can invoke sqlite3_open_v2()
      with SQLITE_OPEN_FULLMUTEX. But would require non completely
      trivial changes.</p></div></blockquote><div>Thanks. I can work around this issue for now.</div><div><br></div><div>Changes in GDAL might be nice, but I need to work with what's available today. I could certainly PR the first suggestion if there is interest. Perhaps I'm at the point where I should be using PROJ directly rather than as wrapped by GDAL.<br></div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature">Andrew Bell<br><a href="mailto:andrew.bell.ia@gmail.com" target="_blank">andrew.bell.ia@gmail.com</a></div></div>