Closed GoogleCodeExporter closed 9 years ago
Try using hibernate-memcached with the latest version of spymemcached.
If that doesn't help and you think there's a bug, I suggest the following...
Dive into the source code and find a fix.
Fork the project and provide a patch.
Send a pull request and I'll merge it in.
Original comment by raykrue...@gmail.com
on 7 Aug 2010 at 1:18
I already updated to the current version of spymemcached (2.5) but the problem
still exists.
Where do you think the bug is... hibernate-memcached or spymemcached (so which
source to have a look at)?
But i have to admit that i am not the guru java coder... so the outcome from a
patch of mine i unsure ;)
Original comment by Werzi2...@gmx.de
on 7 Aug 2010 at 1:26
After a long time i digged into this problem again. I asked the spymemcached
and they told me that the shutdown() method must be called to terminate the
threads.
As i looked at your code you seem to call this method from
com.googlecode.hibernate.memcached.spymemcached.SpyMemcache.shutdown()
But this method itself never gets called. Is this a bug in
hibernate-memcached... this method should get called, shouldn't it? Or is there
any way i can call this method on my on on application shutdown (i don't see
that hibernate has any API to get this done).
Thanks!
Original comment by we...@appsoft.de
on 1 Mar 2011 at 3:31
Hibernate creates many instances of the cache implementation we provide to it.
All of those instances share the same spymemcached client. Which means that
when hibernate tells us to destroy the cache, we cannot safely shutdown the
client...
https://github.com/raykrueger/hibernate-memcached/blob/master/src/main/java/com/
googlecode/hibernate/memcached/MemcachedCache.java#L192
If you look at the code that creates the Spymecache client...
https://github.com/raykrueger/hibernate-memcached/blob/master/src/main/java/com/
googlecode/hibernate/memcached/spymemcached/SpyMemcacheClientFactory.java
You'll see that there is a property there for enabling daemon mode via a config
property.
Set hibernate.memcached.daemonMode=true and you should be good.
This tells spymemcache to use daemon threads that shutdown with the VM.
In the future please use the google group for questions and the issue tracking
for actual confirmed bugs.
Original comment by raykrue...@gmail.com
on 1 Mar 2011 at 3:41
That the client is not shut on destroying a cache seems to be ok but there
should be a point when the client is shut down (at least there should be a
possibility to do this on my own).
No setting daemonMode doesn't fix the problem. Tomcat cannot shutdown as some
threads seems to remain running.
Could you please tell me where to find the google group? Although i consider
this as a bug.
Original comment by we...@appsoft.de
on 1 Mar 2011 at 3:57
I found the group :)
http://groups.google.com/group/hibernate-memcached?pli=1
Original comment by we...@appsoft.de
on 1 Mar 2011 at 3:58
Original issue reported on code.google.com by
Werzi2...@gmx.de
on 7 Aug 2010 at 1:15