integrityerror upon model.save()

4 views
Skip to first unread message

ozgurisil

unread,
Dec 2, 2009, 6:06:35 AM12/2/09
to Djapian Users
Hi,

I have some models indexed by djapian. Naturally, whenever an indexed
model is saved, it sends a signal to djapian. However, from time to
time, upon receiving signal from one specific model, djapian raises an
IntegrityError. The traceback is given below.

I appreciate any help.

Regards,
Ozgur

Traceback (most recent call last):

File "/home/ozgurisil/django-tahministan/django/core/handlers/
base.py", line 92, in get_response
response = callback(request, *callback_args, **callback_kwargs)

File "/home/ozgurisil/django-tahministan/django/utils/decorators.py",
line 36, in __call__
return self.decorator(self.func)(*args, **kwargs)

File "/home/ozgurisil/django-tahministan/django/contrib/auth/
decorators.py", line 24, in _wrapped_view
return view_func(request, *args, **kwargs)

File "/home/ozgurisil/tahministan/pm_core/views.py", line 664, in
trade_handler
transaction=perform_transaction(user, contract, quantity, tr_type)

File "/home/ozgurisil/tahministan/pm_core/models.py", line 1061, in
perform_transaction
market.save()

File "/home/ozgurisil/tahministan/pm_core/models.py", line 457, in
save
super(Market, self).save()

File "/home/ozgurisil/django-tahministan/django/db/models/base.py",
line 410, in save
self.save_base(force_insert=force_insert,
force_update=force_update)

File "/home/ozgurisil/django-tahministan/django/db/models/base.py",
line 506, in save_base
created=(not record_exists), raw=raw)

File "/home/ozgurisil/django-tahministan/django/dispatch/
dispatcher.py", line 166, in send
response = receiver(signal=self, sender=sender, **named)

File "/home/ozgurisil/tahministan/djapian/signals.py", line 8, in
post_save
Change.objects.create(object=instance, action= created and "add" or
"edit")

File "/home/ozgurisil/tahministan/djapian/models.py", line 32, in
create
old_change.save()

File "/home/ozgurisil/tahministan/djapian/models.py", line 65, in
save
super(Change, self).save()

File "/home/ozgurisil/django-tahministan/django/db/models/base.py",
line 410, in save
self.save_base(force_insert=force_insert,
force_update=force_update)

File "/home/ozgurisil/django-tahministan/django/db/models/base.py",
line 495, in save_base
result = manager._insert(values, return_id=update_pk)

File "/home/ozgurisil/django-tahministan/django/db/models/
manager.py", line 177, in _insert
return insert_query(self.model, values, **kwargs)

File "/home/ozgurisil/django-tahministan/django/db/models/query.py",
line 1087, in insert_query
return query.execute_sql(return_id)

File "/home/ozgurisil/django-tahministan/django/db/models/sql/
subqueries.py", line 320, in execute_sql
cursor = super(InsertQuery, self).execute_sql(None)

File "/home/ozgurisil/django-tahministan/django/db/models/sql/
query.py", line 2369, in execute_sql
cursor.execute(sql, params)

File "/home/ozgurisil/django-tahministan/django/db/backends/mysql/
base.py", line 84, in execute
return self.cursor.execute(query, args)

File "/var/lib/python-support/python2.5/MySQLdb/cursors.py", line
166, in execute
self.errorhandler(self, exc, value)

File "/var/lib/python-support/python2.5/MySQLdb/connections.py", line
35, in defaulterrorhandler
raise errorclass, errorvalue

IntegrityError: (1062, "Duplicate entry '24-257' for key 2")

Alex Koshelev

unread,
Dec 2, 2009, 6:31:18 PM12/2/09
to djapia...@googlegroups.com
Hi, Ozgur.

I think your problem is related to this issue [1]. It is on top of my TODO list. So you can star it at google code and track status.

[1]: http://code.google.com/p/djapian/issues/detail?id=97&

---
Alex Koshelev



--

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.



ozgurisil

unread,
Dec 3, 2009, 1:09:36 AM12/3/09
to Djapian Users
Thanks, Alex.

On Dec 3, 1:31 am, Alex Koshelev <daeva...@gmail.com> wrote:
> Hi, Ozgur.
>
> I think your problem is related to this issue [1]. It is on top of my TODO
> list. So you can star it at google code and track status.
>
> [1]:http://code.google.com/p/djapian/issues/detail?id=97&
>
> ---
> Alex Koshelev
>
> > djapian-user...@googlegroups.com<djapian-users%2Bunsu...@googlegroups.com>
> > .

ozgurisil

unread,
Jan 19, 2010, 5:58:19 AM1/19/10
to Djapian Users
Hi Alex,

Any progress pertaining to this issue? Issue #97 is "wontfix"ed,
however it seems to be irrelevant to my problem.

Regards,

Ozgur

Reply all
Reply to author
Forward
0 new messages