just a note : extends EJBObject -> extends EntityBean
Dain Sundstrom wrote:
Luttrell, Peter wrote:
Bill also suggested that it was my code, which i don't think is the
case. I
could be wrong ~ can anyone suggest how i can optimize this constructor:
public MyValueObject(SomeLocalInterface ejb){
name = ejb.getName();
id = ejb.getId();
someOtherField = ejb.getSomeOtherField();
}
There are about 10 fields or so. I did double check and realize that
one of
them is a field on a relationship, which may be the source of the
problem.
You are doing 10 invocations through the ejb layers. The code will be
way more efficient if you put the value object creation code inside the
entity bean. For example
public abstract class MyEntityBean extends EJBObject {
public MyValueObject getValueObject() {
MyValueObject valueObject = new MyValueObject();
valueObject.setName(getName());
valueObject.setId(getId());
valueObject.setSomeOtherField(getSomeOtherField());
}
}
The important difference is the loading of the value object gets all of
the data from the ejb using calls inside of the bean instance and
specifically the calls don't travel over a Remote or Local interface.
This means there is no code interpositioned.
-dain
-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in
Las Vegas (supported by COMDEX), the only Apache event to be
fully supported by the ASF. http://www.apachecon.com
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user
--
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
| Emerson Cargnin |
| Analista de Sistemas Sr. |
| Tel : (051) 3358-4959 |
| SICREDI Serviços |
| Porto Alegre - Brasil |
|xxxxxxxxxxxxxxxxxxxxxxxxxx|
-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in
Las Vegas (supported by COMDEX), the only Apache event to be
fully supported by the ASF. http://www.apachecon.com
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user