#16484: Duplicate entry sessions error
----------------------------------+------------------------------------
     Reporter:  hash.3g@…         |                    Owner:  nobody
         Type:  Bug               |                   Status:  reopened
    Component:  contrib.sessions  |                  Version:  1.3
     Severity:  Normal            |               Resolution:
     Keywords:                    |             Triage Stage:  Accepted
    Has patch:  0                 |      Needs documentation:  0
  Needs tests:  0                 |  Patch needs improvement:  0
Easy pickings:  0                 |                    UI/UX:  0
----------------------------------+------------------------------------

Comment (by sidmitra.del@…):

 I think i can duplicate the error. I have the same Mysql version(with
 INNODB).


 {{{

 File "/home/ubuntu/.virtualenvs/app/lib/python2.6/site-
 packages/django/core/handlers/base.py", line 178, in get_response
   response = middleware_method(request, response)
  File "/home/ubuntu/.virtualenvs/app/lib/python2.6/site-
 packages/django/contrib/sessions/middleware.py", line 36, in
 process_response
   request.session.save()
  File "/home/ubuntu/.virtualenvs/app/lib/python2.6/site-
 packages/django/contrib/sessions/backends/cached_db.py", line 31, in save
   super(SessionStore, self).save(must_create)
  File "/home/ubuntu/.virtualenvs/app/lib/python2.6/site-
 packages/django/contrib/sessions/backends/db.py", line 63, in save
   obj.save(force_insert=must_create, using=using)
  File "/home/ubuntu/.virtualenvs/app/lib/python2.6/site-
 packages/django/db/models/base.py", line 460, in save
   self.save_base(using=using, force_insert=force_insert,
 force_update=force_update)
  File "/home/ubuntu/.virtualenvs/app/lib/python2.6/site-
 packages/django/db/models/base.py", line 553, in save_base
   result = manager._insert(values, return_id=update_pk, using=using)
  File "/home/ubuntu/.virtualenvs/app/lib/python2.6/site-
 packages/django/db/models/manager.py", line 195, in _insert
   return insert_query(self.model, values, **kwargs)
  File "/home/ubuntu/.virtualenvs/app/lib/python2.6/site-
 packages/django/db/models/query.py", line 1436, in insert_query
   return query.get_compiler(using=using).execute_sql(return_id)
  File "/home/ubuntu/.virtualenvs/app/lib/python2.6/site-
 packages/johnny/cache.py", line 344, in newfun
   ret = original(cls, *args, **kwargs)
  File "/home/ubuntu/.virtualenvs/app/lib/python2.6/site-
 packages/django/db/models/sql/compiler.py", line 791, in execute_sql
   cursor = super(SQLInsertCompiler, self).execute_sql(None)
  File "/home/ubuntu/.virtualenvs/app/lib/python2.6/site-
 packages/johnny/cache.py", line 293, in newfun
   return original(cls, *args, **kwargs)
  File "/home/ubuntu/.virtualenvs/app/lib/python2.6/site-
 packages/django/db/models/sql/compiler.py", line 735, in execute_sql
   cursor.execute(sql, params)
  File "/home/ubuntu/.virtualenvs/app/lib/python2.6/site-
 packages/django/db/backends/mysql/base.py", line 86, in execute
   return self.cursor.execute(query, args)
  File "/home/ubuntu/.virtualenvs/app/lib/python2.6/site-
 packages/MySQLdb/cursors.py", line 174, in execute
   self.errorhandler(self, exc, value)
  File "/home/ubuntu/.virtualenvs/app/lib/python2.6/site-
 packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
   raise errorclass, errorvalue
  IntegrityError: (1062, “Duplicate entry
 ‘e4d75e04ee5995bd2e03d25a697a00d1’ for key 'PRIMARY'”)


 }}}


 Here're my session settings:

 {{{

 SESSION_ENGINE                      =
 'django.contrib.sessions.backends.cached_db'
 SESSION_COOKIE_AGE                  = 2 * 60 * 60
 SESSION_EXPIRE_AT_BROWSER_CLOSE     = True

 }}}

 Note: I use johnnny-cache alongside

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16484#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to