> -----Original Message----- > From: Philip Martin [mailto:philip.mar...@wandisco.com] > Sent: woensdag 27 juli 2011 21:23 > To: Mark Phippard > Cc: Subversion Development > Subject: Re: Forcing the SQLite db to close? > > Mark Phippard <markp...@gmail.com> writes: > > > Noticed a problem in Eclipse. When someone wants to remove a project > from > > Eclipse, the .svn folder cannot be deleted because the wc.db file is in use. > > This is because, unlike the command line, when we are using JavaHL the > > process does not end until someone closes Eclipse. > > > > Is there an API we could add to JavaHL or something to tell SVN to close the > > DB handles so that the file is not locked? > > > > Bert/Stefan, how are you dealing with this problem in your GUI tools? I > > know you have access to more API than we have for JavaH, so maybe there > is > > already an API and it just needs to be exposed? > > There is a private function svn_wc__db_drop_root, I think that does what > you want. What do you want the public API to look like?
Or you can close the wc context with svn_wc_context_destroy(). This closes all contexts at once. (Clearing the pool with svn_client_ctx_t / svn_wc_context_t has the same effect). Answering Mark's question: In SharpSvn I added a boolean on the SvnClient. With the boolean set to false (the default) I create a new svn_wc_context_t for every command invocation and clear the pool containing that temporary context when the command is done. (svn_client_ctx_t lives much longer to cache passwords, etc.) This keeps everything compatible with the old version and users that need the extra performance can switch the boolean. In AnkhSVN with this per command closing of the database 1.7 is still much faster than 1.6, so I haven't even looked at cases where I want to keep the db open. Bert