Re: [Resin-interest] HempMemoryQueue Exception when synchronizing sessions between two nodes in a cluster

2009-12-18 Thread Wesley Wu
I gave some code for the request:

Cache cache = cacheManager.getCache("forumPageCache");
cache.put("forum_1_page_1", postListInForum1Page1);
cache.put("forum_1_page_2", postListInForum1Page2);
cache.put("forum_1_page_3", postListInForum1Page3);
cache.put("forum_2_page_1", postListInForum2Page1);
cache.put("forum_2_page_2", postListInForum2Page2);

When forum2 got a new post, then the page1 & page2 of forum2 should be
stale and must be removed,
while all pages in forum1 remained valid.

My request : I should remove the stale cache entries ("forum_2_page1"
& "forum_2_page2") by a maintainable manner?

I want to do some search like this

List cacheKeys = myCacheKeySearcher.doSearch(new
SearchCriteria("forumId = 2"));
for (String key : cacheKeys) {
   cache.remove(key);
}

Normally the search capability will be implemented by a lucene
in-memory IndexSearcher.

And I'll use a CacheEventListener or some AOP interceptor to
synchronize the cache keys
to the keys index store.

My problem is:

While I could index and search all the index keys in one JVM, how
could I synchronized the
keys index store (a lucene memory store) across the cluster?

-Wesley


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] HempMemoryQueue Exception when synchronizing sessions between two nodes in a cluster

2009-12-18 Thread Jon Stevens
Not sure what you mean, but here is an example of checking to see if
something is in the cache, if it is missing, populating the cache and then
returning the object...


I have a @Service CacheMgrHelperBean bean which wraps around my caches and
makes them available to my other beans...


I will say that I think the need to do new Element() is pretty lame. imho,
there should be a cache.put(Object, Object) method.


 @SuppressWarnings("unchecked")

*public* Map> getShootClips(Long shootId)
*throws*NotFoundException

{

*if* (shootId == *null*)

*throw* *new* NotFoundException("shootId was null");


 Map> val = *new* HashMap>();

Cache cache = *this*.cacheMgrHelper.getShootClipsCache();


 *try*

{

Element element = cache.get(shootId);

*if* (element == *null*)

{

val = *this*.getShootClipsUnCached(shootId);

*if* (val != *null* && val.size() > 0)

cache.put(*new* Element(shootId, val));

}

*else*

{

val = (Map>)element.getValue();

}

}

*catch* (CacheException ce)

{

*log*.warn(ce);

*try*

{

// Last ditch fallback.

val = *this*.getShootClipsUnCached(shootId);

cache.remove(shootId);

}

*catch* (CacheException ce1)

{

//do nothing...

}

}


 *if* (val == *null*)

*return* Collections.*emptyMap*();


 *return* val;

}

cheers,

jon

On Fri, Dec 18, 2009 at 1:03 PM, Wesley Wu  wrote:

> Fortunately I found ehcache's concept is very like Jbosscache with
> regional eviction and cache loader.
> I really did not know ehcache had gone such far in the last two years,
> otherwise I should have evaluated it intensively :p
>
> That means my abstract cache layer won't need too much modification to
> accommodate ehcache.
>
> One of the feature I think ehcache may miss is the searchability of
> cache entries by key or property values.
> I've used Jbosscache Searchable edition (which use lucene) and it did
> some trick for me to search given cache entries and let them go stale.
>
> Any corrections or suggestions?
>
> Thanks very much, Jon.
>
> -Wesley
>
> 2009/12/19 Wesley Wu :
> > Great Jon, you help me to make a critical decision (not to use JBC any
> > more and switch to EHC & Terracotta).
> >
> > I'll give it a shot.
> >
> > -Wesley
> >
> > 2009/12/19 Jon Stevens :
> >> yep, i've had several conversations with the cto of terracotta and they
> are
> >> very on the ball about their products.
> >> jon
> >>
> >> On Thu, Dec 17, 2009 at 11:42 PM, Wesley Wu  wrote:
> >>>
> >>> Thanks Jon, I'll definitely give terracotta a try.
> >>>
> >>> As far as I know, EHCache was a opensymphony project one or two years
> >>> ago. I noticed that ehcache was acquired by terracotta and became a
> >>> key component of terracotta.
> >>>
> >>> That's great!
> >>>
> >>> -Wesley
> >>>
> >>>
> >>> ___
> >>> resin-interest mailing list
> >>> resin-interest@caucho.com
> >>> http://maillist.caucho.com/mailman/listinfo/resin-interest
> >>
> >>
> >> ___
> >> resin-interest mailing list
> >> resin-interest@caucho.com
> >> http://maillist.caucho.com/mailman/listinfo/resin-interest
> >>
> >>
> >
>
>
> ___
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] HempMemoryQueue Exception when synchronizing sessions between two nodes in a cluster

2009-12-18 Thread Wesley Wu
Fortunately I found ehcache's concept is very like Jbosscache with
regional eviction and cache loader.
I really did not know ehcache had gone such far in the last two years,
otherwise I should have evaluated it intensively :p

That means my abstract cache layer won't need too much modification to
accommodate ehcache.

One of the feature I think ehcache may miss is the searchability of
cache entries by key or property values.
I've used Jbosscache Searchable edition (which use lucene) and it did
some trick for me to search given cache entries and let them go stale.

Any corrections or suggestions?

Thanks very much, Jon.

-Wesley

2009/12/19 Wesley Wu :
> Great Jon, you help me to make a critical decision (not to use JBC any
> more and switch to EHC & Terracotta).
>
> I'll give it a shot.
>
> -Wesley
>
> 2009/12/19 Jon Stevens :
>> yep, i've had several conversations with the cto of terracotta and they are
>> very on the ball about their products.
>> jon
>>
>> On Thu, Dec 17, 2009 at 11:42 PM, Wesley Wu  wrote:
>>>
>>> Thanks Jon, I'll definitely give terracotta a try.
>>>
>>> As far as I know, EHCache was a opensymphony project one or two years
>>> ago. I noticed that ehcache was acquired by terracotta and became a
>>> key component of terracotta.
>>>
>>> That's great!
>>>
>>> -Wesley
>>>
>>>
>>> ___
>>> resin-interest mailing list
>>> resin-interest@caucho.com
>>> http://maillist.caucho.com/mailman/listinfo/resin-interest
>>
>>
>> ___
>> resin-interest mailing list
>> resin-interest@caucho.com
>> http://maillist.caucho.com/mailman/listinfo/resin-interest
>>
>>
>


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] HempMemoryQueue Exception when synchronizing sessions between two nodes in a cluster

2009-12-18 Thread Wesley Wu
Great Jon, you help me to make a critical decision (not to use JBC any
more and switch to EHC & Terracotta).

I'll give it a shot.

-Wesley

2009/12/19 Jon Stevens :
> yep, i've had several conversations with the cto of terracotta and they are
> very on the ball about their products.
> jon
>
> On Thu, Dec 17, 2009 at 11:42 PM, Wesley Wu  wrote:
>>
>> Thanks Jon, I'll definitely give terracotta a try.
>>
>> As far as I know, EHCache was a opensymphony project one or two years
>> ago. I noticed that ehcache was acquired by terracotta and became a
>> key component of terracotta.
>>
>> That's great!
>>
>> -Wesley
>>
>>
>> ___
>> resin-interest mailing list
>> resin-interest@caucho.com
>> http://maillist.caucho.com/mailman/listinfo/resin-interest
>
>
> ___
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>
>


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] HempMemoryQueue Exception when synchronizing sessions between two nodes in a cluster

2009-12-18 Thread Jon Stevens
yep, i've had several conversations with the cto of terracotta and they are
very on the ball about their products.

jon


On Thu, Dec 17, 2009 at 11:42 PM, Wesley Wu  wrote:

> Thanks Jon, I'll definitely give terracotta a try.
>
> As far as I know, EHCache was a opensymphony project one or two years
> ago. I noticed that ehcache was acquired by terracotta and became a
> key component of terracotta.
>
> That's great!
>
> -Wesley
>
>
> ___
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] HempMemoryQueue Exception when synchronizing sessions between two nodes in a cluster

2009-12-17 Thread Wesley Wu
Thanks Jon, I'll definitely give terracotta a try.

As far as I know, EHCache was a opensymphony project one or two years
ago. I noticed that ehcache was acquired by terracotta and became a
key component of terracotta.

That's great!

-Wesley


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] HempMemoryQueue Exception when synchronizing sessions between two nodes in a cluster

2009-12-17 Thread Jon Stevens
Yea, I've been using it for 3 years, clustered. I recently moved to ehcache
and all my problems magically went away, I got way better JMX stats and
performance increased. That and I configured ehcache in invalidation mode.
WAAAY better than replication.

jon


On Thu, Dec 17, 2009 at 7:05 PM, Wesley Wu  wrote:

> thanks Jon & Jeff, lol, I'll take a serious look at ehcache + terracotta.
>
> I've used JBossCache for more than 2 years, but only on single JVM
> (not clustered).
>
> I might think the clustered cache should be working as they advertised.
>
> -Wesley
>
> 2009/12/18 Jeff Schnitzer :
> > I know that Jon has spent many, many days debugging and tuning JBoss
> > Cache on a production cluster, so I'd endorse his "review", despite
> > the brashness.
> >
> > Jeff
> >
> > On Thu, Dec 17, 2009 at 3:37 PM, Jon Stevens  wrote:
> >> DO NOT USE JBOSS CACHE. Pile of shit.
> >> ehcache + terracotta (yes, there is an oss free version) = love.
> >> I'm not super clear on what you want, but it sounds like you want the
> >> TIM-MasterWorker (ExecutorService):
> >>
> http://forge.terracotta.org/releases/projects/tim-messaging/docs/about.html
> >> jon
> >> On Thu, Dec 17, 2009 at 11:51 AM, Wesley Wu  wrote:
> >>>
> >>> So if I want my beans synchronized across the cluster, I have to use
> >>> either JMS or some thirdparty cluster middleware like JBossCache?
> >>>
> >>> -Wesley
> >>>
> >>>
> >>> ___
> >>> resin-interest mailing list
> >>> resin-interest@caucho.com
> >>> http://maillist.caucho.com/mailman/listinfo/resin-interest
> >>
> >>
> >> ___
> >> resin-interest mailing list
> >> resin-interest@caucho.com
> >> http://maillist.caucho.com/mailman/listinfo/resin-interest
> >>
> >>
> >
> >
> > ___
> > resin-interest mailing list
> > resin-interest@caucho.com
> > http://maillist.caucho.com/mailman/listinfo/resin-interest
> >
>
>
> ___
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] HempMemoryQueue Exception when synchronizing sessions between two nodes in a cluster

2009-12-17 Thread Wesley Wu
thanks Jon & Jeff, lol, I'll take a serious look at ehcache + terracotta.

I've used JBossCache for more than 2 years, but only on single JVM
(not clustered).

I might think the clustered cache should be working as they advertised.

-Wesley

2009/12/18 Jeff Schnitzer :
> I know that Jon has spent many, many days debugging and tuning JBoss
> Cache on a production cluster, so I'd endorse his "review", despite
> the brashness.
>
> Jeff
>
> On Thu, Dec 17, 2009 at 3:37 PM, Jon Stevens  wrote:
>> DO NOT USE JBOSS CACHE. Pile of shit.
>> ehcache + terracotta (yes, there is an oss free version) = love.
>> I'm not super clear on what you want, but it sounds like you want the
>> TIM-MasterWorker (ExecutorService):
>> http://forge.terracotta.org/releases/projects/tim-messaging/docs/about.html
>> jon
>> On Thu, Dec 17, 2009 at 11:51 AM, Wesley Wu  wrote:
>>>
>>> So if I want my beans synchronized across the cluster, I have to use
>>> either JMS or some thirdparty cluster middleware like JBossCache?
>>>
>>> -Wesley
>>>
>>>
>>> ___
>>> resin-interest mailing list
>>> resin-interest@caucho.com
>>> http://maillist.caucho.com/mailman/listinfo/resin-interest
>>
>>
>> ___
>> resin-interest mailing list
>> resin-interest@caucho.com
>> http://maillist.caucho.com/mailman/listinfo/resin-interest
>>
>>
>
>
> ___
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] HempMemoryQueue Exception when synchronizing sessions between two nodes in a cluster

2009-12-17 Thread Jeff Schnitzer
I know that Jon has spent many, many days debugging and tuning JBoss
Cache on a production cluster, so I'd endorse his "review", despite
the brashness.

Jeff

On Thu, Dec 17, 2009 at 3:37 PM, Jon Stevens  wrote:
> DO NOT USE JBOSS CACHE. Pile of shit.
> ehcache + terracotta (yes, there is an oss free version) = love.
> I'm not super clear on what you want, but it sounds like you want the
> TIM-MasterWorker (ExecutorService):
> http://forge.terracotta.org/releases/projects/tim-messaging/docs/about.html
> jon
> On Thu, Dec 17, 2009 at 11:51 AM, Wesley Wu  wrote:
>>
>> So if I want my beans synchronized across the cluster, I have to use
>> either JMS or some thirdparty cluster middleware like JBossCache?
>>
>> -Wesley
>>
>>
>> ___
>> resin-interest mailing list
>> resin-interest@caucho.com
>> http://maillist.caucho.com/mailman/listinfo/resin-interest
>
>
> ___
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>
>


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] HempMemoryQueue Exception when synchronizing sessions between two nodes in a cluster

2009-12-17 Thread Jon Stevens
DO NOT USE JBOSS CACHE. Pile of shit.

ehcache + terracotta (yes, there is an oss free version) = love.

I'm not super clear on what you want, but it sounds like you want the
TIM-MasterWorker (ExecutorService):

http://forge.terracotta.org/releases/projects/tim-messaging/docs/about.html

jon

On Thu, Dec 17, 2009 at 11:51 AM, Wesley Wu  wrote:

> So if I want my beans synchronized across the cluster, I have to use
> either JMS or some thirdparty cluster middleware like JBossCache?
>
> -Wesley
>
>
> ___
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] HempMemoryQueue Exception when synchronizing sessions between two nodes in a cluster

2009-12-17 Thread Wesley Wu
So if I want my beans synchronized across the cluster, I have to use
either JMS or some thirdparty cluster middleware like JBossCache?

-Wesley


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] HempMemoryQueue Exception when synchronizing sessions between two nodes in a cluster

2009-12-17 Thread Scott Ferguson
Wesley Wu wrote:
> Thanks. I switched back to 091202 snapshot and this issue was resolved.
>
> Would u take some time to look at my other mail about
> @ApplicationScoped bean distribution?
>   
I'm pretty sure the distributed events got dropped from the spec. It 
really was a capability that just didn't belong.

In any case, there's never been a distributed bean concept in the spec, 
just distributed events.

-- Scott

> -Wesley
>
> 2009/12/18 Scott Ferguson :
>   
>> Wesley Wu wrote:
>> 
>>> this node is using Resin-4.0.s091216
>>> the other is using Resin-4.0.s091202
>>>
>>>   
>> The exception itself is a known issue that's blocking 4.0.3, but you
>> also can't mix those two versions. We needed to change the cluster
>> protocol to handle our upcoming EC2 support, and those two snapshots are
>> basically a before-and-after of the change.
>>
>> -- Scott
>> 
>>> -Wesley
>>>
>>>
>>> ___
>>> resin-interest mailing list
>>> resin-interest@caucho.com
>>> http://maillist.caucho.com/mailman/listinfo/resin-interest
>>>
>>>
>>>   
>>
>>
>> ___
>> resin-interest mailing list
>> resin-interest@caucho.com
>> http://maillist.caucho.com/mailman/listinfo/resin-interest
>>
>> 
>
>
> ___
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>
>   




___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] HempMemoryQueue Exception when synchronizing sessions between two nodes in a cluster

2009-12-17 Thread Wesley Wu
Thanks. I switched back to 091202 snapshot and this issue was resolved.

Would u take some time to look at my other mail about
@ApplicationScoped bean distribution?

-Wesley

2009/12/18 Scott Ferguson :
> Wesley Wu wrote:
>> this node is using Resin-4.0.s091216
>> the other is using Resin-4.0.s091202
>>
> The exception itself is a known issue that's blocking 4.0.3, but you
> also can't mix those two versions. We needed to change the cluster
> protocol to handle our upcoming EC2 support, and those two snapshots are
> basically a before-and-after of the change.
>
> -- Scott
>> -Wesley
>>
>>
>> ___
>> resin-interest mailing list
>> resin-interest@caucho.com
>> http://maillist.caucho.com/mailman/listinfo/resin-interest
>>
>>
>
>
>
>
> ___
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] HempMemoryQueue Exception when synchronizing sessions between two nodes in a cluster

2009-12-17 Thread Scott Ferguson
Wesley Wu wrote:
> this node is using Resin-4.0.s091216
> the other is using Resin-4.0.s091202
>   
The exception itself is a known issue that's blocking 4.0.3, but you 
also can't mix those two versions. We needed to change the cluster 
protocol to handle our upcoming EC2 support, and those two snapshots are 
basically a before-and-after of the change.

-- Scott
> -Wesley
>
>
> ___
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>
>   




___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] HempMemoryQueue Exception when synchronizing sessions between two nodes in a cluster

2009-12-17 Thread Wesley Wu
this node is using Resin-4.0.s091216
the other is using Resin-4.0.s091202

-Wesley


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest