Re: Application Data sharing -- store large object?

2005-04-11 Thread Larry Meadors
Maybe I am missing something, but this sounds like a data model that should 
live in a database. 

That way, you could have your database layer (iBATIS or Hibernate) cahce it 
for you, and use standard APIs to get to the data.

Larry

On Apr 11, 2005 11:59 AM, Daxin Zuo <[EMAIL PROTECTED]> wrote:
> 
> Stefan,
> Thank you for your reply. It is very helpful. I may use a CACHE as you
> mentioned.
> I like to ask another question.
> 1) The object I am going to cache is large, and dynamically changed
> according to users actions.
> 2) Currently our program runs with Tomcat/Apache, it has to support other
> java application servers -- Weblogic, ..., and different platforms -- 
> Unix,
> Linux, Windows.
> 
> Do you have instruction for the selection among the various CACHE plug-in?
> 
> Thanks again.
> 
> -Original Message-
> From: Stefan Frank [mailto:[EMAIL PROTECTED]
> Sent: Monday, April 11, 2005 12:04 AM
> To: 'Tomcat Users List'
> Subject: RE: Application Data sharing -- store large object?
> 
> You should maybe take a look into the various caching-libraries available
> (ehcache, swarmcache, jboss-treecache etc.) - these libraries deal with
> cacheing, which is a little different from what the
> application/session-objects offer, as application and session have to be
> absolutely reliable. If you store something in it, you can safely expect 
> to
> find it again. Therefore, this objects cannot deal with things like 
> running
> out of memory - they cannot simply throw out objects, when things get too
> crowded.
> 
> On the other hand, Cacheing-Systems always have policies to deal with such
> situations(eg. Swarm-cache dynamically adapts to your usage-patterns) and
> can throw out old or un-needed objects, whenever it gets too crowded -
> therefore, you cannot always expect an object that you put into the cache 
> to
> be still present after a while - so you have to deal with refetching it,
> when you have nop cache-hit. You may want to look into O\R-Mapping
> Frameworks like hibernate: they already have these caches built in and 
> take
> care of re-fetching objects, when they have expired from the cache.
> 
> From a pure memory point of view, there is no difference. If you 
> absolutely
> need your complex object 100% of the time, it makes no difference, if you
> keep it in the application or if you put it in an in-memory cache.
> 
> Hope this helps
> stf
> 
> > -----Original Message-
> > From: Daxin Zuo [mailto:[EMAIL PROTECTED]
> > Sent: Sonntag, 10. April 2005 19:23
> > To: Tomcat Users List
> > Subject: Application Data sharing -- store large object?
> >
> > In my program, an object that contains a large amount of data
> > (complicated data strustures) is used in many pages. When I
> > start doing it, I heard that it is better to not store large
> > object in Application. So I let the program create a new one
> > when ever this object is needed. Now I like to question if it
> > is good to put this object in Application.
> >
> > Thanks.
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>


RE: Application Data sharing -- store large object?

2005-04-11 Thread Daxin Zuo
Stefan,
   Thank you for your reply. It is very helpful. I may use a CACHE as you
mentioned.
I like to ask another question.
  1) The object I am going to cache is large, and dynamically changed
according to users  actions.
  2) Currently our program runs with Tomcat/Apache, it has to support other
java application servers -- Weblogic, ..., and different platforms -- Unix,
Linux, Windows.

 Do you have instruction for the selection among the various CACHE plug-in?

Thanks again.

-Original Message-
From: Stefan Frank [mailto:[EMAIL PROTECTED]
Sent: Monday, April 11, 2005 12:04 AM
To: 'Tomcat Users List'
Subject: RE: Application Data sharing -- store large object?


You should maybe take a look into the various caching-libraries available
(ehcache, swarmcache, jboss-treecache etc.) - these libraries deal with
cacheing, which is a little different from what the
application/session-objects offer, as application and session have to be
absolutely reliable. If you store something in it, you can safely expect to
find it again. Therefore, this objects cannot deal with things like running
out of memory - they cannot simply throw out objects, when things get too
crowded.

On the other hand, Cacheing-Systems always have policies to deal with such
situations(eg. Swarm-cache dynamically adapts to your usage-patterns) and
can throw out old or un-needed objects, whenever it gets too crowded -
therefore, you cannot always expect an object that you put into the cache to
be still present after a while - so you have to deal with refetching it,
when you have nop cache-hit. You may want to look into O\R-Mapping
Frameworks  like hibernate: they already have these caches built in and take
care of re-fetching objects, when they have expired from the cache.

>From a pure memory point of view, there is no difference. If you absolutely
need your complex object 100% of the time, it makes no difference, if you
keep it in the application or if you put it in an in-memory cache.

Hope this helps
stf

> -Original Message-
> From: Daxin Zuo [mailto:[EMAIL PROTECTED]
> Sent: Sonntag, 10. April 2005 19:23
> To: Tomcat Users List
> Subject: Application Data sharing -- store large object?
>
> In my program, an object that contains a large amount of data
> (complicated data strustures) is used in many pages. When I
> start doing it, I heard that it is better to not store large
> object in Application. So I let the program create a new one
> when ever this object is needed. Now I like to question if it
> is good to put this object in Application.
>
> Thanks.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Application Data sharing -- store large object?

2005-04-11 Thread Daxin Zuo
I means if it is good to put a large Object in the ServletContext. This
Object contains a lot of complicated data structure, the data is dymanically
used.

In all the text books, when they tell the usage of ServletContext object,
always use simple string, int, or simple bean.
I heard before that it is not good to put too much data in ServletContext.
If it is true, how it will hurt the system or the data stored in
ServletContext if put tool much data in it. So I can decide how to do
according to my reality. I donnot consern the amount of memory. Please
forward instruction.
Thanks

-Original Message-
From: Jerome Jar [mailto:[EMAIL PROTECTED]
Sent: Sunday, April 10, 2005 8:28 PM
To: Tomcat Users List
Subject: Re: Application Data sharing -- store large object?


Cofused about your question.
A Singleton object???

On Apr 11, 2005 1:22 AM, Daxin Zuo <[EMAIL PROTECTED]> wrote:
> In my program, an object that contains a large amount of data (complicated
> data strustures) is used in many pages. When I start doing it, I heard
that
> it is better to not store large object in Application. So I let the
program
> create a new one when ever this object is needed. Now I like to question
if
> it is good to put this object in Application.
>
> Thanks.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Application Data sharing -- store large object?

2005-04-11 Thread Stefan Frank
You should maybe take a look into the various caching-libraries available
(ehcache, swarmcache, jboss-treecache etc.) - these libraries deal with
cacheing, which is a little different from what the
application/session-objects offer, as application and session have to be
absolutely reliable. If you store something in it, you can safely expect to
find it again. Therefore, this objects cannot deal with things like running
out of memory - they cannot simply throw out objects, when things get too
crowded. 

On the other hand, Cacheing-Systems always have policies to deal with such
situations(eg. Swarm-cache dynamically adapts to your usage-patterns) and
can throw out old or un-needed objects, whenever it gets too crowded -
therefore, you cannot always expect an object that you put into the cache to
be still present after a while - so you have to deal with refetching it,
when you have nop cache-hit. You may want to look into O\R-Mapping
Frameworks  like hibernate: they already have these caches built in and take
care of re-fetching objects, when they have expired from the cache.

>From a pure memory point of view, there is no difference. If you absolutely
need your complex object 100% of the time, it makes no difference, if you
keep it in the application or if you put it in an in-memory cache. 

Hope this helps
stf   

> -Original Message-
> From: Daxin Zuo [mailto:[EMAIL PROTECTED] 
> Sent: Sonntag, 10. April 2005 19:23
> To: Tomcat Users List
> Subject: Application Data sharing -- store large object?
> 
> In my program, an object that contains a large amount of data 
> (complicated data strustures) is used in many pages. When I 
> start doing it, I heard that it is better to not store large 
> object in Application. So I let the program create a new one 
> when ever this object is needed. Now I like to question if it 
> is good to put this object in Application.
> 
> Thanks.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Application Data sharing -- store large object?

2005-04-10 Thread Jerome Jar
Cofused about your question.
A Singleton object???

On Apr 11, 2005 1:22 AM, Daxin Zuo <[EMAIL PROTECTED]> wrote:
> In my program, an object that contains a large amount of data (complicated
> data strustures) is used in many pages. When I start doing it, I heard that
> it is better to not store large object in Application. So I let the program
> create a new one when ever this object is needed. Now I like to question if
> it is good to put this object in Application.
> 
> Thanks.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Application Data sharing -- store large object?

2005-04-10 Thread Daxin Zuo
In my program, an object that contains a large amount of data (complicated
data strustures) is used in many pages. When I start doing it, I heard that
it is better to not store large object in Application. So I let the program
create a new one when ever this object is needed. Now I like to question if
it is good to put this object in Application.

Thanks.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]