[djapian-users] Exception Type: DatabaseLockError. Please help!

18 views
Skip to first unread message

jul

unread,
Apr 27, 2010, 8:34:55 AM4/27/10
to Djapian Users
Hi,

I've got the exception shown below when executing indexer.update(). I
have no idea about what to do: it used to work and now index database
seems "locked".

Anybody can help?

Thanks


*************
Environment:

Request Method: POST
Request URL: http://piem.org:8000/restaurant/add/
Django Version: 1.1.1
Python Version: 2.5.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.comments',
'django.contrib.sites',
'django.contrib.admin',
'registration',
'djapian',
'resto',
'multilingual']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.locale.LocaleMiddleware',
'multilingual.middleware.DefaultLanguageMiddleware')


Traceback:
File "/var/lib/python-support/python2.5/django/core/handlers/base.py"
in get_response
92. response = callback(request, *callback_args,
**callback_kwargs)
File "/home/jul/atable/../atable/resto/views.py" in addRestaurant
639. Restaurant.indexer.update()
File "/home/jul/python-modules/Djapian-2.3.1-py2.5.egg/djapian/
indexer.py" in update
181. database = self._db.open(write=True)
File "/home/jul/python-modules/Djapian-2.3.1-py2.5.egg/djapian/
database.py" in open
20. xapian.DB_CREATE_OR_OPEN,
File "/usr/lib/python2.5/site-packages/xapian.py" in __init__
2804.
_xapian.WritableDatabase_swiginit(self,_xapian.new_WritableDatabase(*args))

Exception Type: DatabaseLockError at /restaurant/add/
Exception Value: Unable to acquire database write lock on /home/jul/
atable/djapian_spaces/resto/restaurant/resto.index.restaurantindexer:
already locked

--
You received this message because you are subscribed to the Google Groups "Djapian Users" group.
To post to this group, send email to djapia...@googlegroups.com.
To unsubscribe from this group, send email to djapian-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/djapian-users?hl=en.

Alex Koshelev

unread,
Apr 27, 2010, 9:22:17 AM4/27/10
to djapia...@googlegroups.com
Hi, jul!

Xapian can handle only one writer to its database at once. So you don't have to call `index.update()` from your views. Use `manage.py index` command with scheduler to update index.

---
Alex Koshelev
Reply all
Reply to author
Forward
0 new messages