[JBoss Cache Users] - Re: Locking parent nodes even with lockParentForChildInsertR
by tknyziak
Sorry for not replying for so long.
I've tried replacing 3.2.0 with 3.2.1 and it didn't help - still, as can be seen on the stack trace, parent nodes get being locked for writing:
| org.jboss.cache.lock.TimeoutException: Unable to acquire lock on Fqn [/node_name] after [1100] milliseconds for requestor [Thread[RMI TCP Connection(46)-192.168.251.104,5,RMI Runtime]]! Lock held by [Thread[RMI TCP Connection(41)-192.168.251.104,5,RMI Runtime]]
| at org.jboss.cache.mvcc.MVCCNodeHelper.acquireLock(MVCCNodeHelper.java:159)
| at org.jboss.cache.mvcc.MVCCNodeHelper.wrapNodeForWriting(MVCCNodeHelper.java:236)
| at org.jboss.cache.mvcc.MVCCNodeHelper.wrapNodeForWriting(MVCCNodeHelper.java:186)
| at org.jboss.cache.mvcc.MVCCNodeHelper.wrapNodeForWriting(MVCCNodeHelper.java:226)
| at org.jboss.cache.mvcc.MVCCNodeHelper.wrapNodeForWriting(MVCCNodeHelper.java:186)
| at org.jboss.cache.mvcc.MVCCNodeHelper.wrapNodeForWriting(MVCCNodeHelper.java:226)
| at org.jboss.cache.mvcc.MVCCNodeHelper.wrapNodeForWriting(MVCCNodeHelper.java:186)
| at org.jboss.cache.mvcc.MVCCNodeHelper.wrapNodeForWriting(MVCCNodeHelper.java:226)
| at org.jboss.cache.mvcc.MVCCNodeHelper.wrapNodeForWriting(MVCCNodeHelper.java:186)
| at org.jboss.cache.interceptors.MVCCLockingInterceptor.handlePutDataMapCommand(MVCCLockingInterceptor.java:94)
|
I don't understand why all parent nodes need to be write-locked - [I assume the direct parent of the inserted node might be locked so a new child information can be updated] - but seems like their absence in the InvocationContext causes a cache-wide lock until they're actually read into it (createdIfAbsent, if you will). Sure I can bump up the timeout, but I suppose it's a work-around rather than a real solution.
Any thoughts?
Kind regards
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4260733#4260733
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4260733
16 years, 9 months
[JNDI and Naming] - EJB2 SB calls EJB3 SB and gets wrong Remote Interface
by magicroomy
Hi,
i encountered a strange behaviour in JBoss 5.1.0 if a EJB2 SessionBean tries to lookup a EJB3 Session Bean.
The situation is as follows:
1. The EJB3 is coded like that:
...
@Stateless(name="EJB3")
@RemoteHome(EJB3Home.class)
public class EJB3Bean implements EJB3
{
...
2. EJB3Home looks like this:
public interface EJB3Home extends EJBHome
{
public EJB3Remote create() throws CreateException, RemoteException;
}
3. EJB3 is the EJB3 Business Remote Interface and looks like this:
@Remote
public interface EJB3
{
public void doThings() ;
4. EJB3Remote is a Remote Interface according to the EJB2 Spec:
public interface EJB3Remote extends EJBObject
{
public void doThings() throws RemoteException ;
...
5. For the EJB2 there is a deployment descriptor defined. The section for the EJB2 Session Bean contains the following ejb-ref:
...
<ejb-ref>
<ejb-ref-name>EJB2Remote</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
EJB3Home
EJB3Remote
<ejb-link>EJB3</ejb-link>
</ejb-ref>
...
6. The EJB2 does a Lookup like
Object obj = jndi.lookup("EJB2Remote") ;
What i would expect is an object implementing EJB3Home.
I can call create() with it and get a EJB3Remote Object.
But what i get instead is an object of type EJB3, the Business Interface.
This confuses me and is different to Bea Weblogic 10.3.1.
Bea correctly delivers the Home.
Since we have to develop for Bea and JBoss i need to find a way to get the Remote Interfaces the same way.
Anything i did wrong to get the EJB3Home?
I already checked the following links for help:
http://java.sun.com/mailers/techtips/enterprise/2007/TechTips_Feb07.html
and
http://www.jboss.org/file-access/default/members/jbossejb3/freezone/docs/...
Both articles presented ways to interact that did not work on both App Servers.
Greetings
Volker
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4260729#4260729
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4260729
16 years, 9 months