save object reference in db?

J

Jamal Soueidan

Hi everyone,

I want to ask if it's possible to save object reference in database for
later use?

Regards,
Jamal
 
R

Robert Klemme

2008/10/27 Jamal Soueidan said:
I want to ask if it's possible to save object reference in database for
later use?

No, not directly. How should that work?

You either need an OR mapper (for example ActiveRecord) or you store
complete object graphs serialized (via Marshal in a BLOB or YAML in a
CLOB).

Cheers

robert
 
B

Brian Candler

Robert said:
No, not directly. How should that work?

Well, technically it *is* possible to save object references - see
weakref.rb for an implementation.

But this is almost certainly not what the OP wants (since those object
references won't survive garbage collection, or application restart)
 
R

Robert Klemme

2008/10/27 Brian Candler said:
Well, technically it *is* possible to save object references - see
weakref.rb for an implementation.

Hey, normally *I* am supposed to be the nitpick! What's the point in
storing something that you cannot reasonably retrieve? This is only
useful for a WOM. *gg*
But this is almost certainly not what the OP wants (since those object
references won't survive garbage collection, or application restart)

Exactly!

Kind regards

robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top