Hi Johan,
I'm not sure about SVN (I never investigated Subversion locking code) side but 
from SQLite side 
SQLJet uses the same locking techniques.

In SVNKit TIMEOUT is hardcoded too (10 seconds). See 
SVNSqlJetDb.DEFAULT_BUSY_HANDLER:

http://svn.svnkit.com/repos/svnkit/trunk/svnkit/src/main/java/org/tmatesoft/svn/core/internal/db/SVNSqlJetDb.java

As one can see SqlJetPager#waitOnLock: it tries to lock a file and waits a bit 
(with gradually 
increasing timeout: 1, 2, 5, ...) in a cycle until the whole timeout (10s) is 
exceeded.


SVNKit locking code starts here:

SVNSqlJetDb#beginTransaction  (then SQLJet code: 
->SqlJetEngine#beginTransaction-
>SqlJetEngine#doBeginTransaction->ISqlJetBtree#beginTrans)

ISqlJetBtree#beginTrans performs all locking depending on transaction mode (as 
you can see it has 
rather complex code).

(Then after SVNSqlJetDb#beginTransaction SVNKit gets SQLJet cursor, walks 
through table according to 
query and finishes the transaction unlocking wc.db). All the locks are released 
after each SQLJet 
operation.

What about BUSY error in IDE: I've never met a situation (at least since stable 
SVNKit versions like 
1.7.5-v1) where it occurred in a situation other than expected (i.e. in an 
attempt of concurrent 
write operation), so to my opinion if it occurs, it's a problem of SVN 
operations serialization.

--
Dmitry Pavlenko,
TMate Software,
http://subgit.com/ - git-svn bridge

> Hi,
> 
> While looking at issue IDEA-85496 [1], an issue in IntelliJ IDEA,
> which uses SVNKit for its svn integration, I'm wondering about the
> locking semantics of the wc.db.
> 
> I've asked around on the svn dev mailinglist about how it works in
> native svn [2]. Does SVNKit (with sqljet) use the same techniques?
> Does it also have a 10 second timeout for the database lock? Any known
> differences in locking behavior between svnkit+sqljet and native
> svn+sqlite ?
> 
> [1] http://youtrack.jetbrains.com/issue/IDEA-85496 - Getting svn:
> E200030: Commit failed (details follow): svn: E200030: BUSY
> [2] http://svn.haxx.se/dev/archive-2012-10/0365.shtml and
> http://svn.haxx.se/dev/archive-2012-10/0387.shtml

Reply via email to