Performance: T3 vs. Local Interfaces ?
Hi there!
What gain in performance can be expected from Local Interfaces?
T3 and Local Interfaces are ment to tackle the same problem, if I'm not mistaken:
enabling a local call to a Bean
without serializing the parameters (enabling call by reference).
I have implemented a test scenario using:
- T3 with <enable-call-by-reference> false
- T3 with <enable-call-by-reference> true
- Local Interfaces and <enable-call-by-reference> false
The testcase with T3 and <enable-call-by-reference> false is the slowest obviously.
The testcase with T3 and <enable-call-by-reference> true works 15% faster.
The testcase with local interfaces shows NO improvement compared to
T3 and <enable-call-by-reference> false.
Is there anything else I have to think about when using local Interfaces - any
switch forgotten?
Or do local interfaces do not improve performance?
Thanks for any help...
Manfred Schneider
Hi there!
What gain in performance can be expected from Local Interfaces?
T3 and Local Interfaces are ment to tackle the same problem, if I'm not mistaken:
enabling a local call to a Bean
without serializing the parameters (enabling call by reference).
I have implemented a test scenario using:
- T3 with <enable-call-by-reference> false
- T3 with <enable-call-by-reference> true
- Local Interfaces and <enable-call-by-reference> false
The testcase with T3 and <enable-call-by-reference> false is the slowest obviously.
The testcase with T3 and <enable-call-by-reference> true works 15% faster.
The testcase with local interfaces shows NO improvement compared to
T3 and <enable-call-by-reference> false.
Is there anything else I have to think about when using local Interfaces - any
switch forgotten?
Or do local interfaces do not improve performance?
Thanks for any help...
Manfred Schneider
Similar Messages
-
No performance gain when using local interfaces
Hello,
I'm doing some tests to compare performances between remote ejb interfaces and local ejb interfaces.
I have two stateless session beans EJB1 and EJB2, EJB1 calls a method on EJB2, this method receives one object as the only parameter and returns it immediately. The parameter is a big object (~700ko). My test consists simply of making 1000 calls from EJB1 to EJB2, one time with remote interfaces, one time with local interface. For both tests, the EJBs run in the same container, same VM.
The results show absolutely no differences between the remote and the local interface !
As I found these results a bit surprising, I changed the serialization method of my parameter object this way:
private void writeObject(java.io.ObjectOutputStream out) throws IOException {
System.out.println("writeObject(MyBigObject)");
out.defaultWriteObject();
just to check if my object is serialized when using remote interface. And the response is no.
So question is: is there an "undocumented optimization" of the stub/skel generated by weblogic which make local calls when calling a remote method inside the same VM ?
Some precisions:
- I'am using weblogic 8.1sp2
- When calling remotely my EJB2 from an external batch (running in a separate VM), I see the message "writeObject(MyBigObject)" so the serialization is done in this case.<Fr?d?ric Chopard> wrote in message news:[email protected]..
So question is: is there an "undocumented optimization" of the stub/skel generated by weblogic which make local calls when callinga remote method inside the same VM ?
>
Some precisions:
- I'am using weblogic 8.1sp2
- When calling remotely my EJB2 from an external batch (running in a separate VM), I see the message "writeObject(MyBigObject)" sothe serialization is done in this case.
WebLogic 5.x, 6.x and 7.x do call by reference for co-located EJBs by default. 8.1 has this behavior turned off by default. You may
experience call-by-reference optimization in 8.1 only if it has been turned on explicitly in the deployment descriptor.
Hope this helps.
Regards,
Slava Imeshev -
Local Interfaces in WebLogic 7.0 Not Faster Than Remote Interfaces?
I was curious how much faster calling business methods in
a stateless session EJB in WebLogic 7.0 would be through
a local interface than calling the same business methods
through a remote interface. I timed both ways of calling
the same methods and much to my surprise the times were
nearly identical. I double-checked that in one case I really
used the local interface (using ejb-local-ref, local-jndi-name,
local interfaces in source code). Does anybody (perhaps from
BEA) have an explanation for this? By the way, I ran the
same experiment with other J2EE application servers such
as IBM's WebSphere 5 (Beta) and there was a tremendous
performance difference between local and remote interface
usage.
Thanks,
Reinhard"Reinhard Klemm" <[email protected]> wrote in message
news:[email protected]...
I appreciate your response and, at the same time, I am somewhat
surprised about it. Here are the reasons for my surprise:
1. Your response indicates that WebLogic uses RMI for
EJB local method calls, i.e., even if the client is on the same VM.
I would have assumed that WebLogic would bypass RMI in such
a situation.That is not what I said. Local interfaces wont use rmi.
But remote interfaces do better if the call is from the same VM. This is
weblogic rmi optimization. Please see Rob's posting also.
2. Other J2EE application servers fare a lot better. In one
experiment, I timed WebLogic against WebSphere 5.0 Technology
for Developers (i.e., WebSphere 5.0 Beta, which is expressly
NOT for performance testing) and against the Sun Reference
Implementation. Here are the numbers for calling business
methods in a stateless session EJB through its local interface:
WebLogic: 5.15 ms on the average
WebSphere: 0.41 ms on the average
Sun Reference Implementation: 0.11 ms on the average
This indicates to me that both WebSphere and the Sun Reference
Implementation are better optimized than WebLogic by excluding
RMI when making local EJB calls.
Reinhard
"Maruthi Nuthikattu" <[email protected]> wrote in message
news:<[email protected]>...
Can you post some numbers so that we can visualize the difference.
Please add the numbers with other J2EE appserver also.
Otherwise top of my head, the reason is:
Weblogic rmi is well optimized for the calls with in the same JVM andsame
J2EE application.
This could be the reason you are not seeing much difference.
..maruthi
"Reinhard Klemm" <[email protected]> wrote in message
news:[email protected]...
I was curious how much faster calling business methods in
a stateless session EJB in WebLogic 7.0 would be through
a local interface than calling the same business methods
through a remote interface. I timed both ways of calling
the same methods and much to my surprise the times were
nearly identical. I double-checked that in one case I really
used the local interface (using ejb-local-ref, local-jndi-name,
local interfaces in source code). Does anybody (perhaps from
BEA) have an explanation for this? By the way, I ran the
same experiment with other J2EE application servers such
as IBM's WebSphere 5 (Beta) and there was a tremendous
performance difference between local and remote interface
usage.
Thanks,
Reinhard -
RPC web service session beans and local interfaces
I am wondering if it is possible to use EJB 2.0's local
interface (vs remote interface) with 6.1's RPC web service
session beans. Since WLS generates the SOAP servlet that
invokes the RPC session bean and I do not find
a way to some how tell SOAP servlet to use local interface to
get the session bean's local home interface, I am not sure
this can be done.
Any comments would be appreciated.
Thanks.
PeterTa. Thanks for the info.
Any idea when Local I/F support is due?
-Nick
"Neal Yin" <[email protected]> wrote:
>
"Nick Minutello" <[email protected]>
wrote
in message news:3d4413a4$[email protected]..
I was just about to post the very same question - but for WLS 7.0.0.1.
There are essentially two questions:
1) (from a functional perspective)
Can I expose Local Interfaces as SOAP using the auto-generation(servicegen ant
tasks)?Local Interfaces support is coming.
2) (from a performance perspective)
Does the generated SOAP implementation go via the (expensive) RemoteInterface
(ie marshalling) - or is the RMI marshalling optimised out (by setting<enable-call-by-reference>true</>)?
You can set this option by yourself on your EJB. Web service runtime
doesn't
do any magic in this area.
Regards,
Nick
"Peter" <[email protected]> wrote:
I am wondering if it is possible to use EJB 2.0's local
interface (vs remote interface) with 6.1's RPC web service
session beans. Since WLS generates the SOAP servlet that
invokes the RPC session bean and I do not find
a way to some how tell SOAP servlet to use local interface to
get the session bean's local home interface, I am not sure
this can be done.
Any comments would be appreciated.
Thanks.
Peter -
My understanding is that the concept of local interfaces (i.e.
direct invocation in lieu of an IPC) exist in EJB 2.0. Does
OC4J support this today? If not, will there be support for it
in 9i AS 2.0?
Thanks.oc4j/orion supports ejb 2.0 as it stood in the second draft.
There have been many changes since then, including dropping DO's
and using Local Interfaces instead.
OC4J/Orion will have a new version by the end of this year or
early next year which will implement ejb 2.0.
Until then, if you want the speed you would get with local
interfaces in oc4j/orion, you can modify your orion-ejb-jar.xml
to use copy-by-value="false". This will give you the same
performance gain as using local interfaces. Its a hack, but what
the heck, it works.
Regards,
the elephantwalker
www.elephantwalker.com -
Hi *,
does anybody know if localinterfaces work in WLS7 SP1?
thanx,
YauheniYes. my classes were inclueded in system CLASSPATH. but Sun spec says nothing about
that local interfaces could work only in the application context. it says that restriction
is that it could work only on the same JVM. so it looks very strange, isn't it? i
will try to pack everything in ear and try it again.
Thanx,
Yauheni
"Dimitri I. Rakitine" <[email protected]> wrote:
Yes, it looks like this is a problem. Your application used to work on 6
because you
added all your classes to the system classpath, right? And it sounds like
in 7, local
calls also depend on the application environment being set.
Yauheni Prykhodzka <[email protected]> wrote:
actually, may be that is the problem, we have no ear. we have a set ofjars with
ejbs and a set of web applications, whci are not packed in war. couldit be a problem,
when i use local interfaces?
but spec says that local interface could be used inside a JVM. i thinkit should
not play a role, if classloadres of ejb and component that use ejb aredifferent.
is it true?
Yauheni
"Dimitri I. Rakitine" <[email protected]> wrote:
Do you mean that servlet, which is a part of a .war which is deployed
in
the
same .ear with the EJB components fails to invoke EJB's using local interfaces?
Yauheni Prykhodzka <[email protected]> wrote:
"Dimitri I. Rakitine" <[email protected]> wrote:
Interesting. I guess that the problem will go away if you stop using
startup
classes
(for example, use load-on-startup servlet instead to perform initialization
steps).
No. I get the same problem after weblogic started. If i try to use localinterfaces
from another bean o servlet i get the same exception.
Yauheni
Yauheni Prykhodzka <[email protected]> wrote:
Here is the exception, which i'm getting:
<10.07.2002 11:43:55 CEST> <Emergency> <WebLogicServer> <000342> <Unableto init
ialize the server: Fatal initialization exception
Throwable: weblogic.t3.srvr.FatalStartupException: Can't start serverdue to sta
rtup class failure IdGeneratorStartUp - with nested exception:
[javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundExcept
ion: remaining name: /app/ejb/dox.comp.IdGenerator.jar#IdGenerator/local-home];
Link Remaining Name: 'java:app/ejb/dox.comp.IdGenerator.jar#IdGenerator/local-ho
me']
javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundExcept
ion: remaining name: /app/ejb/dox.comp.IdGenerator.jar#IdGenerator/local-home
<<no stack trace available>>
--------------- nested within: ------------------
weblogic.t3.srvr.FatalStartupException: Can't start server due to
startup
class
failure IdGeneratorStartUp - with nested exception:
[javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundExcept
ion: remaining name: /app/ejb/dox.comp.IdGenerator.jar#IdGenerator/local-home];
Link Remaining Name: 'java:app/ejb/dox.comp.IdGenerator.jar#IdGenerator/local-ho
me']
at weblogic.t3.srvr.StartupClassRunner$1.run(StartupClassRunner.java:95)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
eManager.java:721)
at weblogic.t3.srvr.StartupClassRunner.run(StartupClassRunner.java:71)
at java.lang.Thread.run(Thread.java:484)
>
The WebLogic Server did not start up properly.
the JNDI name for local interface is IdGeneratorLocalHome. i use thisname for lookup.
Thanx,
Yauheni--
Dimitri--
Dimitri
Dimitri -
Local Interfaces & location transparency
hi,
i would realy like to hear your oppinions on this:
How does local interfaces go along with ejb location transparency ?
When using local objects, arn't you compromising location transparency
because you are stating, that this bean runs on the same vm as your client bean. Using remote calls, the client does not make any assumptions as to the location of the bean it is accessing.
How does this go along with like bean-level fail-over stategies, load balancing or other concepts based in distributing beans over different servers.
Thanks for any insights
volkerI must admit that I've not thought about this all that much before!
You're right that it assumes that the local bean is indeed local. There are mitigations (in my opinion) for this not being as crucial as for a remote bean.
A local bean is really just the halfway-house between a remote EJB and vanilla Java code. It provides various conveniences needed for the construction of enterprise applications but addresses the overhead inherent in a typical remote EJB.
So why not simply use a Java class that's not a local EJB? That's always an option but you'd be losing the ability of that code to participate with the EJB session in a transparent fashion.
The severity of not having bean-level failover etc. is perhaps marginal as the bean is already being invoked from a scaleable component (a remote EJB). Under what circumstances would the local bean fail but the calling remote bean be able to continue? There are undoubtedly some cases where even this wouldn't be sufficient but in such cases a remote EJB is still available to the application developer.
At the end of the day it's a fairly straightforward compromise between flexibility and performance.
The benefits of local beans are hopefully clear (and no doubt espoused in the EJB spec) and the costs are pretty much as you've described.
I, too, would be interested to hear other people's opinions... -
Problem accessing local interface methods
Hi all,
I have problems accessing local interfaces of entity beans in OC4J.
My application consists of a session bean as a facade for two local entity beans.
Everytime I try to execute methods on the local interfaces for the entity beans, I receive an exception: "java.lang.InternalError: Illegal removing from cache".
When debugging the application everything seems to be fine until the method calls on the local interfaces (lookups, create methods etc OK). I can even see that the local interface method is acually executed when performing a System.out...! But the method doesn't return to the client (session bean). Instead I revieve the exception above.
I found a similar problem on the orion mail archive (http://www.mail-archive.com/[email protected]/msg17754.html). But there they seem to have problem with removing beans. For me, removing beans works fine too.
Any suggestions would be appreciated.
/johan
[email protected]Hi all,
I have problems accessing local interfaces of entity beans in OC4J.
My application consists of a session bean as a facade for two local entity beans.
Everytime I try to execute methods on the local interfaces for the entity beans, I receive an exception: "java.lang.InternalError: Illegal removing from cache".
When debugging the application everything seems to be fine until the method calls on the local interfaces (lookups, create methods etc OK). I can even see that the local interface method is acually executed when performing a System.out...! But the method doesn't return to the client (session bean). Instead I revieve the exception above.
I found a similar problem on the orion mail archive (http://www.mail-archive.com/[email protected]/msg17754.html). But there they seem to have problem with removing beans. For me, removing beans works fine too.
Any suggestions would be appreciated.
/johan
[email protected] -
Remote interface / Local interface
Hi
I would like to if its possible to avoid using remote interfaces completely and improve performance by using - JSP -> Servlet -> (local interface) Session bean -> Entity bean ???
Let the client call from JSP which is sent to control servlet which uses local-interface to send the request to a session bean that may in turn interact with Entity bean ?
Is there any specific guidelines regarding that ?
Thanks
Rameshbuilding thru ANT is much more helpful, fast and efficient(I personally haven't tried any tools for builing EARs...:-)....Check out the EAR task in the ANT documentation...it describes each of its option and you will also find the EXAMPLES which you can download and tweak according to your beans....
-
Remote and local interface on same ejb 3.0 bean instance
Hi,
Is it posible to get remote and local interface on same ejb 3.0 bean instance.
For example get local interface of a bean and than pass it as remote to client.
Both interfaces must operate on same bean instance.
Thanks
Zlajayes. You can implement multiple interfaces on a single class, so you can add a local and a remote interface. One trick to avoid duplicate code is to simply make the remote interface extend the local interface; then you only have to add the @Remote annotation and you're done.
For example get local interface of a bean and than pass it as remote to client.You don't pass an instances to a client, a client looks up a remote instance of the bean through JNDI. -
Weblogic 10.3.2 EJB3 Local Interface in POJO/Helper classes
Hi,
I have a jar file containing all EJB's in application & some Helper classes. I want to access Local interfaces of EJBs in those helper classes. Is there any way I can do it? I've gone through Maxence Button & Jay SenSharma 's blogs about accessing Local interface. but it doesn't help. May be these two guys can help me more here.. My requirement is very simple. Just to access local interface in POJO/Helper classes that are in same JAR file as EJB's. I can't get reference with @EJB class level annotation as Helper classes are called independently from MBean services.. not from any EJB or Servlert.
Please if anyone can tell me how do I get reference of local interfaces, that would be really good.
my environment is
Weblogic 10.3.2
EJB3
Regards,
PrasadHi,
Just check ...If you want something like mentioned in the below Link with a complete Example:
[http://jaysensharma.wordpress.com/2009/08/16/weblogic-10-3-ejb3-local-lookup-sample/|http://jaysensharma.wordpress.com/2009/08/16/weblogic-10-3-ejb3-local-lookup-sample/]
Regards
Jay SenSharma -
Bad performance with Payables Open Interface Import
hello all
have a performance problem with the standard program Payables Open Interface Import, as this process is taking a long time to run.
could recommend some patch for this issue or a solution.
our application is 11.5.10.2 and Database 10g
now create a SR but to date we have not been sending the first plan of action
best regardsThere are many reasons this is a performance problem - search in MOS for "APXIIMPT performance" or "payables open interface import performance"
Your best bet is to work this thru an SR.
Have you traced the concurrent to determine where the bottleneck is ? Are statistics current ?
HTH
Srini -
Use of local interface btw EAR
hi,
Can i use local interfaces to call session bean of EAR1 from EAR2. in my case EAR1 and EAR2 are deployed in the weblogic instance(same jvm). and parameters are being passed by value(because of 2 different classloaders).
I tried doin this ... but resulted in exception being thrown when i tried to do a lookup to the localhome of EAR1.
Please advise,
venkatHi,
Even though they are running in the same JVM, the classes are not visible between EAR1 and EAR2 because they are loaded in separate classloaders, therefore local interfaces won't work.
-thorick -
How can I get a reference to the Local interface of a EJB 3 session?
Hi,
How can I get a reference to the Local interface of a EJB 3 session?
My session implements both the local and remote interfaces, so in my client, when I look up the remote interface using the following code, I did get a reference
processor = (IItemProcessorRemote)initialContext.lookup(IItemProcessorRemote.class.getName());but if I also look up the local interface in th eclient using this:
processorLocal =(IItemProcessor)initialContext.lookup(IItemProcessor.class.getName());I got errors like the following, do you know why? Thanks a lot!
Exception in thread "main" javax.naming.NameNotFoundException: sessions.IItemProcessor not found
at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:203)
at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:175)
at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:61)
at com.sun.enterprise.naming.RemoteSerialContextProviderImpl.lookup(RemoteSerialContextProviderImpl.java:116)
at sun.reflect.GeneratedMethodAccessor114.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)BTW, findItemByTitle(String title) is a business method in my ItemProcessor session bean.
public String findItemByTitle(String title) {
AuctionItem item;
String result = null;
try {
Query query = entityManager
.createNativeQuery("SELECT i from AuctionItem i WHERE i.title LIKE : aTitle");
query.setParameter("aTitle", title);
item = (AuctionItem) query.getSingleResult();
result = item.toString();
} catch (EntityNotFoundException notFound) {
} catch (NonUniqueResultException nonUnique) {
return result;
} -
EJB 3.0 Session bean local interface NullPointerException
I am trying a very simple test of a Stateless EJB 3.0 bean called from a servlet.
The bean has a local interface, annotated with @Local. The bean implements that interface and is annotated with @Stateless.
I have a servlet with a variable of the local interface type, annotated with @EJB. The servlet's doGet method invokes the bean's one method using that interface and it works fine.
BUT if I put the same variable, annotated with @EJB into another class in the web container, it is not injected correctly and I get a NullPointerException on the variable. This class is in WEB-INF/classes with the servlet class, so I assume it is loaded by the same classloader.
I don't understand why the servlet can instantiate the EJB local interface successfully but another class in the web container can't. I get the same result in OC4J standalone 10.1.3.1 and 10.1.3.3.Only managed classes like servlets, filters etc. will have context and EJB references injected into them, and only with servlet version 2.5. A work colleague found the answer in Debu Panda's blog:
http://debupanda.blogspot.com/2006_10_01_archive.html#116184543992078773
This behaviour appears to be part of the EJB 3.0 standard.
The solution is to use JNDI lookup in the client class (POJO) and declare an ejb-local-ref in web.xml.
Maybe you are looking for
-
Development and consolidation same system
Hello All, Can i declare both the development and consolidation as the same system without specifying test and production system in a track? If yes then is there any other factors to be considered? Also the SC state is in grey whereas if i click sync
-
Some icons are not shown correctly in Gnome tray
The image should tell everything. In the tray there should be icons from Guake, Dropbox and Skype. However only Skype is visible. Does anyone know where could be the problem? I noticed that Synergy icon behaves also wrongly. thanks Jan
-
Automatic Payment Program Proposal split same vendor invoices
Hello, We are facing some peculiar issue in Automatic Payment Program,when we run the automatic payment program payment proposal split the same vendor invoices into so many differnt proposals instead of consolidated proposal. Every time it's not happ
-
Lumia virus protection banking etc
Please confirm Lumia 920 ok for banking, ebaying, Paypaling, etc. As at mid 2014. Have been reading past posts saying Windows/Nokia phones ok as closed App Store. And as long as you don't accept weird offers. And PC viruses cannot infect phones. But
-
Error during batch determination in sales order
Hi all, I have this information error during batch determination: LB059 " Error when mixing configuration and selection criteria" . Does anyone know what i´m doing wrong? We are using materials with characteristics, and when i try the batch determina