0

Is it possible for 2 or more threads to add and commit different files to SVN repository using the same working copy?

My program works fine with 1 thread, but 2 threads give me svn exceptions saying that the working copy is locked or (when using SVN kit) that there is a transaction that didn't complete.

I need this because I am trying to migrate from StarTeam to SVN, and I have millions of commits to make, so I need it as fast as possible.

Gilad Baruchian
  • 930
  • 3
  • 14
  • 30

2 Answers2

1

Most SVN commands will lock the working folder, so you can't run them in multiple threads. If the command changes the remote server, they won't run in parallel either, since the server will queue the requests.

If subversion is too slow, you should look at distributed VCS like Mercurial or Git.

[EDIT] If you have to convert a large repo, then you should create one local on your computer. That avoids the network latency for each change. Commits should now be very fast. After you have recreated the whole history in Subversion, you export the repository and ask the server admin to import it.

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
  • I can't it has to be SVN, even if have 2 files in 2 separate folders i cant send 2 requests to commit them? – Gilad Baruchian Dec 03 '15 at 17:38
  • 1
    You can do separate commits even with files in common folder (TBT!) (`svn ci -m "Message" PATH/TO/OBJECT`), but can't predict order or revisions in repo – Lazy Badger Dec 03 '15 at 18:04
  • If you *really* want to avoid latency, use a pair of local SSDs (one for the working copy, one for the repository). But you still have the ordering to contend with if you multi-thread. – alroc Dec 06 '15 at 13:25
0

Replaying over "millions" of commits like this is going to take far too long. Even if you multi-thread on the client, your transactions are serialized on the server and you can easily get transactions out of order if you're throwing multiple at the server concurrently - it's just a question of which one arrives first.

I can't speak to how well it works, but Polarion has a free conversion tool that is built to migrate from Starteam (and other VCSs) to Subversion. I would suggest you start there, or with another purpose-built tool.

These other discussions may be informative as well:

Community
  • 1
  • 1
alroc
  • 27,574
  • 6
  • 51
  • 97
  • polarion doesn't seems to work with our starteam version, it requires starteam80.jar and we have starteam110.jar (because we use starteam 11 sdk) – Gilad Baruchian Dec 06 '15 at 07:50