I can email 2 jars - 4.0.2 and 4.0.0 versions of our webservice(with the
minimal changes). But it uses hibernate3 and oracle legacy stored procs. This
is ours ws4ee-deployment for jboss4.0.0:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
And this is one for jboss4.0.2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
First, when we transfer our ws to 4.0.2 we have changed hibernate-related part
of ws(move it in separate .har), but after that(in order to find the
bottleneck) we have downgrade it to previous version(single jar with hibernate
and ejb classes). In that case there are two versions of our ws for jboss4.0.2
- ear(with jar and har inside) and single jar. In both cases serialization is
slow.
In order to illustrate junit results with timings we have start jboss and tests
on the same machine, so in this tests client connects to localhost. First I
want to say that we run this tests a lot of times so it's not a single moment
jboss4.0.2 behavior.
This is the parts of code of statless session bean (ejbCreate() and public
buisness method)
| ...
| public void ejbCreate() throws CreateException {
| URL log4jConfig = DealerServiceBean.class
| .getResource("/META-INF/log4j.xml");
| DOMConfigurator.configure(log4jConfig);
| logger.info("Logger initialized");
|
| // Create the SessionFactory
| sessionFactory = new Configuration().configure(
|
"/META-INF/jboss-hibernate.cfg.xml").buildSessionFactory();
| }
| ...
|
| public PriceUpdateSoapBean[] getPriceUpdate(long p_log, long
p_firstload) {
| logger.info("into getPriceUpdateSoap()");
| PriceUpdateSoapBean[] pusb = new PriceUpdateSoapBean[1];
| session = sessionFactory.openSession();
| Transaction tx = session.beginTransaction();
| logger.debug("Tx at the beginning");
| Query query = session.getNamedQuery("get_price_update");
| query.setLong("in_log", p_log);
| query.setLong("first_load", p_firstload);
| logger.debug("after binding input values: in_log="+p_log+";
first_load="+p_firstload);
| List l = query.list();
| logger.debug("after executing");
| pusb = (PriceUpdateSoapBean[]) l.toArray(pusb);
| tx.commit();
| logger.info("before return of PriceUpdateSoapBean[] with length
of"+pusb.length);
| return pusb;
| }
|
This is the test for ws:
| public void testGetPriceUpdateInLoop() throws Exception {
| int tr = 10;
| long[] tries = new long[tr];
| for (int i = 0; i < tr; i++) {
| logger.debug("try number:" + i);
| factoryImpl = (ServiceFactoryImpl)
ServiceFactory.newInstance();
|
| Service service = factoryImpl.createService(new
URL(endpoint),
| new File(mapping).toURL(), new
File(deployment).toURL(),
| new
QName("http://interfaces.service.dealer.zenith.ru";,
| "DealerService"), null);
|
| Integer p_log = new Integer(-1);
| Integer p_firstload = new Integer(1);
| Call call3 = (Call) service.createCall(new QName(
|
"http://interfaces.service.dealer.zenith.ru";,
| "DealerServiceBeanEndpoint"),
"getPriceUpdate");
| long start = System.currentTimeMillis();
| PriceUpdateSoapBean[] result = (PriceUpdateSoapBean[])
call3
| .invoke(new Object[] { p_log,
p_firstload });
| long finish = System.currentTimeMillis();
| tries=finish - start;
| logger.debug("time:" + tries);
| assertNotNull(result);
| assertEquals(100, result.length);
| }
|