rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: rack-devel@googlegroups.com
Subject: Re: "singleton can't be dumped" error when storing an object in session
Date: Wed, 30 May 2012 07:53:06 +0000	[thread overview]
Message-ID: <20120530075306.GA2718@dcvr.yhbt.net> (raw)
In-Reply-To: <63a04e19-5c3b-4308-8dc5-f234a9801446@googlegroups.com>

armanx <armanx@gmail.com> wrote:
> On Saturday, May 26, 2012 2:39:08 AM UTC-7, armanx wrote:
> > I'm using Rack::Session::Cookie to store an object (a Sequel model 
> > returned by a database call) in the session. However, I'm getting a 
> > "singleton can't be dumped" error when trying to do so. What is the reason 
> > for this error?

(top-posting corrected)

You need to look up the definition of a singleton object.

> > The interesting thing is, I only get the error when the Sequel object is 
> > first saved in the database then returned; the error is absent when the 
> > record already exists in the database and is returned via select (without 
> > saving), yet in both cases the objects/classes are identical.

Not a Sequel expert here, but could it be Sequel is giving you a
different return value than what you expect?  Can you share this
piece of code that's giving you trouble?

> Is it possible that the object is too large for the 4kb cookie size limit 
> and that's what is causing this error?

No, based on your error, it's not too large.

      reply	other threads:[~2012-05-30  7:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-26  9:39 "singleton can't be dumped" error when storing an object in session armanx
2012-05-29 22:42 ` armanx
2012-05-30  7:53   ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://groups.google.com/group/rack-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120530075306.GA2718@dcvr.yhbt.net \
    --to=rack-devel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).