[jboss-user] [JBossCache] - Re: Problem with concurent put/remove operation.
jacek187
do-not-reply at jboss.com
Wed Aug 22 16:43:22 EDT 2007
impy core on 1.4.1 - described in http://www.jboss.com/index.html?module=bb&op=viewtopic&t=116337 forum thread
I have just tested core on 2.0.0. GA - and exception was ... timeout.
stack:
org.jboss.cache.lock.TimeoutException: failure acquiring lock: fqn=/a/b/c/d, caller=GlobalTransaction::4, lock=write owner=GlobalTransaction::3 (activeReaders=0, activeWriter=Thread[Thread-2,5,main], waitingReaders=0, waitingWriters=0, waitingUpgrader=0)
at org.jboss.cache.lock.IdentityLock.acquire(IdentityLock.java:528)
at org.jboss.cache.interceptors.PessimisticLockInterceptor$LockManager.acquire(PessimisticLockInterceptor.java:579)
at org.jboss.cache.interceptors.PessimisticLockInterceptor.acquireNodeLock(PessimisticLockInterceptor.java:393)
at org.jboss.cache.interceptors.PessimisticLockInterceptor.lock(PessimisticLockInterceptor.java:329)
at org.jboss.cache.interceptors.PessimisticLockInterceptor.invoke(PessimisticLockInterceptor.java:187)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:76)
at org.jboss.cache.interceptors.NotificationInterceptor.invoke(NotificationInterceptor.java:32)
(...)
main loop:
| for (int x = 0; x < 1000; x++) {
| tm.begin();
| if (remove) {
| cache.remove("/a/b/c/d");
| cache.remove("/a");
| } else {
| cache.put("/a/b/c/d", "key","text" + x);
| }
| tm.commit();
| Thread.sleep(1);
| }
|
one thread is putting key-value pair into /a/b/c/d node and second thread is removing this node.
And now I don't known what is it: just bug or normal situation.
If this is normal situation - how TimeoutException can be explained? One thread is executing only one operation in one transaction (classical deadlock needs 2 operations in one transaction...)
I need to run many paraller threads, and every thread should modify exactly this same node. Which cache should be used? [I think that every cache (pojo, core, 1.4.1, 2.0.0 can be used)] Now looks that only PojoCache in version 1.4.1 works correctly in Multithread environment...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077056#4077056
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4077056
More information about the jboss-user
mailing list