Hi there

Now, it shouldn't be much slower. However, there is a performance tradeoff
when using EJB, specially remote ones like you do.
One thing, that really speeds up things is to cache the home interface, when
looking it up, or when the applications starts up.
First use will still be slow, but subsequent uses should be much faster.

I use this approach:

Have a Struts plugin lookup home interfaces, assign a unique name to each
home interface (I am using an int constant) and initialize a Singleton cache
with all homes regisistered with the unique name.

By doing this your homes are ready to use in your action, but it takes a
little longer to deploy/start the application.

A pseudo code for an action might look like this:

MyRemoteHome home = HomeCache.get(HomeCache.MY_HOME_CONSTANT);
MyRemoteObject obj = home.create();
obj.doMyRemoteMethod();
obj.remove();

Hope this is understandable and helps..

Regards

Henrik



----- Original Message ----- 
From: "Koon Yue Lam" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, July 22, 2004 4:42 AM
Subject: About Struts + JBoss preference issue


> Hi ! My application has change from Struts + Tomcat to Struts + Jboss 3.X
>
> I create various struts Actions to deal with incoming request, in the
> Action class, it preform remote lookup of session bean's home
> interface and create, destory ... it.
>
> My session bean has an DAO attach to it to preform database related stuffs
> NO entiy beans in my application since transaction is not a problem
> and most DB query are read only
>
> The question is the speed, it is much slower when I request an Action
> instead of directly request a servlet. Is it normal ? I don't mind a
> little bit preformance tradeoff but I want to know the delay is caused
> by Struts or something else.
>
> Any help?
>
> Regards
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to