I installed svn and used it for some time without any errors. Others working on the same project also used it without any errors. Recently we were rethinking the security of our svn server and we decided that only the owner and the subversion group should be able to make changes to the repository (... which is how it SHOULD be). So I set the permission for the same. After which, we started getting the message "Cannot write activity db". So I reapplied the permissions and that solved it.
Here's what I did:
First I changed the owner of the repository
$ sudo chown -R administrator:subversion /usr/local/svn
In the above command administrator is the server administrator, subversion is the subversion group and /usr/local/svn is the path to the svn repository.
Then I changed the permission on the repository
$ sudo chmod -Rf 770 /usr/local/svn
This solved the problem. In case any of you has a better solution or has any questions please leave a comment.