scoopex
Feb 1st, 2010, 11:55 AM
Hi,
my application runs of very poor performance.
How can i maximize insert performance for a high number and similar types of inserts?
(only the data differs)
Insert performance was 30times better while using a pure EJB3 mechanism.
- Is there a way to disable autocommit?
- How can i perform a commit?
- What a your general hints to maximize insert performance?
The details of my application:
- Spring 3.0.0
- Jboss 5.1
- IBM JDK 1.6
- Messagedriven Bean which collects data from ActiveMQ
- Application writes to a Oracle 10 database
- i have not configured any transaction-management
- i use tx-datasources which are defined in the appserver
- i only do inserts like this:
INSERT INTO FOO.BAR (ID, STATUS, XMLNACHRICHT) VALUES(FOO.BAR_ID_SEQ.nextval, ....)
=> The XMLNACHRICHT is XML fragment and 150 KB
- According to my profiler each insert needs 150ms
- I use org.springframework.jdbc.core.JdbcTemplate.update( sql, Object[])
- Application Conext for JDBC
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:jms="http://www.springframework.org/schema/jms" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<jee:jndi-lookup id="db2DataSource" jndi-name="java:DB2XADS" />
<jee:jndi-lookup id="oracleDatasource" jndi-name="java:RacDS" />
<bean id="lobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHan dler" />
</beans>
- Application Conext for JMS
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:jms="http://www.springframework.org/schema/jms" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<!--
<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="${jms.brokerUrl}" />
</bean>
-->
<jee:jndi-lookup id="connectionFactory" jndi-name="java:activemq/QueueConnectionFactory"></jee:jndi-lookup>
<bean id="messageReceiver"
class="foo.bar.jms.QueueNachrichtMdp" />
<jms:listener-container connection-factory="connectionFactory"
acknowledge="transacted" concurrency="1-4" cache="none">
<jms:listener destination="${jms.destination}" ref="messageReceiver"
method="onMessage" />
</jms:listener-container>
</beans>
my application runs of very poor performance.
How can i maximize insert performance for a high number and similar types of inserts?
(only the data differs)
Insert performance was 30times better while using a pure EJB3 mechanism.
- Is there a way to disable autocommit?
- How can i perform a commit?
- What a your general hints to maximize insert performance?
The details of my application:
- Spring 3.0.0
- Jboss 5.1
- IBM JDK 1.6
- Messagedriven Bean which collects data from ActiveMQ
- Application writes to a Oracle 10 database
- i have not configured any transaction-management
- i use tx-datasources which are defined in the appserver
- i only do inserts like this:
INSERT INTO FOO.BAR (ID, STATUS, XMLNACHRICHT) VALUES(FOO.BAR_ID_SEQ.nextval, ....)
=> The XMLNACHRICHT is XML fragment and 150 KB
- According to my profiler each insert needs 150ms
- I use org.springframework.jdbc.core.JdbcTemplate.update( sql, Object[])
- Application Conext for JDBC
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:jms="http://www.springframework.org/schema/jms" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<jee:jndi-lookup id="db2DataSource" jndi-name="java:DB2XADS" />
<jee:jndi-lookup id="oracleDatasource" jndi-name="java:RacDS" />
<bean id="lobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHan dler" />
</beans>
- Application Conext for JMS
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:jms="http://www.springframework.org/schema/jms" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<!--
<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="${jms.brokerUrl}" />
</bean>
-->
<jee:jndi-lookup id="connectionFactory" jndi-name="java:activemq/QueueConnectionFactory"></jee:jndi-lookup>
<bean id="messageReceiver"
class="foo.bar.jms.QueueNachrichtMdp" />
<jms:listener-container connection-factory="connectionFactory"
acknowledge="transacted" concurrency="1-4" cache="none">
<jms:listener destination="${jms.destination}" ref="messageReceiver"
method="onMessage" />
</jms:listener-container>
</beans>