Problem : Instance Variable or Application Constant Expiring

J

Jhonny

Problem : Instance Variable or Application Constant Expiring

I am parsing an XML, and getting a response object which is quite
large ,hence I cant store that in Session or cookie.
I can not regenerate this response as its from a 3rd party Web
service . Regeneration would spoil the flow of the application.

I have used 3 approaches .
@instance_variable
@@class_variable
$CONSTANT

Limitations:
Application doesn't have a
- Database
- Filestore system

Can someone please let me know a solution by which I can persist a
large string around 10000 to 25000 characters throughout the
application, also which is user specific and not same for all users.

To repeat: I need a way by which I can store a large data(10k -25K
characters) throughout the application.

Approach I followed:
Like mentioned above I have used a $CONSTANT or @@class_variable ,
this approach works fine with mongrel/webrick both locally or on
server(linux). however the same piece of code fails on passenger .

RAILS version (3.0.3 and 3.1.0)
Ruby (1.9.2)
 
Ð

Малъ Зануда

Problem : Instance Variable or Application Constant Expiring
Like mentioned above I have used a $CONSTANT or @@class_variable  ,
this approach works fine with mongrel/webrick both locally or on
server(linux). however the same piece of code fails on passenger .

Which is reason of the failure?
 
R

Robert Klemme

Problem : Instance Variable or Application Constant Expiring

I am parsing an XML, and getting a response object which is quite
large ,hence I cant store that in Session or cookie.
I can not regenerate this response as its from a 3rd party Web
service . Regeneration would spoil the flow of the application.

I have used 3 approaches .
@instance_variable
@@class_variable
$CONSTANT

All these only work if at least the process is the same throughout the
session. For the instance variable approach you need to make sure the
same instance handles requests for one session.
Limitations:
Application doesn't have a
- Database
- Filestore system

Can someone please let me know a solution by which I can persist a
large string around 10000 to 25000 characters throughout the
application, also which is user specific and not same for all users.

That highly depends on the application container you are using. You
might be able to store in filesystem (e.g. marshaled) or in some
specific session store.
To repeat: I need a way by which I can store a large data(10k -25K
characters) throughout the application.

Approach I followed:
Like mentioned above I have used a $CONSTANT or @@class_variable ,
this approach works fine with mongrel/webrick both locally or on
server(linux). however the same piece of code fails on passenger .

RAILS version (3.0.3 and 3.1.0)
Ruby (1.9.2)

Then you should look up passenger documentation for solutions.

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,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top