[JBossCache] - Re: Problem with concurent put/remove operation.
by jacek187
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
18Â years, 8Â months
[JBoss Seam] - Re: When do I need a @Factory?
by floba
yes I do.
here is what i have:
== Authenticator.java ===
@Stateful
@Scope(ScopeType.SESSION)
@Name("authenticator")
public class Authenticator
implements Authenticator_L
@In( create = true )
MySessionBean mySessionBean;
...
=== MySessionBean.java ===
@Stateful
@Scope( ScopeType.APPLICATION )
@Name( "mySessionBean" )
public class MySessionBean
implements MySessionBean_L
{
public String xyz(){ return "xyz"; }
@Create
public void create(){}
@Destroy @Remove
public void remove(){}
}
=== Factories.java ===
@Stateless
@Scope( ScopeType.EVENT )
@Name( "factories" )
public class Factories
implements Factories_L
{
@Logger Log log;
@Factory( "mySessionBean" )
public MySessionBean makeMySessionBean(){
return new MySessionBean();
}
}
With the Factories it works, without it dont.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077054#4077054
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4077054
18Â years, 8Â months
[JBossCache] - Re: Cannot see nodes and attached map in JMX console
by billwangbill
Thanks. I get the following error message by using
Fqn.fromString()
javax.management.IntrospectionException: Failed to find PropertyEditor for type: org.jboss.cache.Fqn
org.jboss.jmx.adaptor.control.Server.invokeOpByName(Server.java:251)
org.jboss.jmx.adaptor.control.Server.invokeOp(Server.java:223)
org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.invokeOp(HtmlAdaptorServlet.java:262)
org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdaptorServlet.java:100)
org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doPost(HtmlAdaptorServlet.java:82)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
However, I am going to use TreeCache to resolve issue like case as follows:
No User A User B
1 Request read v(= 5)
2 Request read v( =5 )
3 Change v (8) (screen)
4 change v (6) (screen)
5 save v Transaction Tb
6 save v Transaction Ta
I want to protect variable v without querying database. So User A save action should be rejected. To do this, Ta need know v is changed by Tb. Ta start after Tb finish.
Thank you again,
Bill
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077052#4077052
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4077052
18Â years, 8Â months