Tomcat Datasource configuration

I describe here my favorite solution to define the datasource of my web applications. To do that in Tomcat : Copy the JDBC driver jar into the Tomcat lib directory define the datasource in the file server.xml: <GlobalNamingResources> <Resource auth=”Container” driverClassName=”oracle.jdbc.OracleDriver” maxActive=”20″ maxIdle=”10″ maxWait=”-1″ name=”jdbc/myGlobalDatasource” password=”password” type=”javax.sql.DataSource” url=”jdbc:oracle:thin:@[server]:[port]:[sid]” username=”user”/> </GlobalNamingResources> map this datasource to your… Continue reading Tomcat Datasource configuration

JBoss transaction manager (Non XA)

This is my configuration for using the transaction manager implementation provided by JBoss outside of a JEE container. This configuration works for database transaction but not for JMS transaction; The configuration is done with Spring which delegates the transaction management to the JBoss implementation. Even if I used all the stuff to be able to… Continue reading JBoss transaction manager (Non XA)

Simple Spring configuration

Spring configuration for use of a simple transaction manager (non XA). The data source must be defined in a JNDI repository (Tomcat in my case). application.xml: <?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: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/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd”> <bean id=”entityManagerFactory” class=”org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean”> <property name=”dataSource” ref=”dataSource” /> <property name=”jpaVendorAdapter”> <bean class=”org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter”> <property name=”databasePlatform” value=”org.hibernate.dialect.Oracle10gDialect” /> <property name=”generateDdl” value=”false”… Continue reading Simple Spring configuration