Hi.
I'm trying to extend JBoss with Entity Bean clustering. Currently I'm writing the 
support for passive creation of Entity Beans. By passive creation I mean creating an 
Entity Bean without invoking its ejbCreate method. I just have the ID of the bean that 
has to be created and I don't care about the state. The idea is to use it like this:


ctx = createEntityBean(id);
setEntityBeanState(ctx, state);

This would be useful if, for example, a bean is created on another node and I want to 
create a local copy as well. My first implementation was to use the InstanceCache:


EnterpriseContext createEntityBean(Object id) {
  EnterpriseContext ctx = cache.get();
  ctx.setId(id);
  cache.insert(ctx);
  return ctx;
}

but the PersistenceStore complained about inserting a bean instance with an invalid 
primary key. So I added the code to set the primary key as well, but then I got the 
EntityBridgeInvocationHanler complaining that EJB home methods are not allowed to 
access CMP or CMR fields:

...
Caused by: javax.ejb.EJBException: EJB home methods are not allowed to access CMP or 
CMR fields: methodName=setName
        at 
org.jboss.ejb.plugins.cmp.bridge.EntityBridgeInvocationHandler.invoke(EntityBridgeInvocationHandler.java:114)
        at org.jboss.proxy.compiler.Runtime.invoke(Runtime.java:59)
        at cmtest.ejb.CounterBean$Proxy.setName()
        ... 35 more

Is there another way to do this or should I pursue this approach?
Thanks,

Jaksa

PS: The code above is just for explaining the problem, I didn't attach the real code 
because it's too big and spans over a lot of classes.

<a 
href="http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3827208#3827208";>View 
the original post</a>

<a 
href="http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3827208>Reply 
to the post</a>


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to