Spring MyBatis configuration

Here I describe the project configuration to use MyBatis as ORM and benefit of the transactions management provided by Spring. For that, we have to add the MyBatis-Spring library to the basic MyBatis. First, the Maven POM is like: <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.2.3</version> </dependency> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>1.2.1</version> </dependency> And now, the Spring configuration file… Continue reading Spring MyBatis configuration

Enable transactions on Informix DB

We need to have the following variables set: INFORMIXDIR=/opt/IBM/informix INFORMIXSQLHOSTS=/opt/IBM/Informix/etc/sqlhosts.ol_informix1170 INFORMIXSERVER=ol_informix1170 Now, we can enable the transactions, in first we need to put the database in “quiescent mode” (???): >/opt/IBM/informix/bin/onmode –uy Note: doing this disable access to the database. enable transactions: >/opt/IBM/informix/bin/ontape –s –L 0 –B d9exp Re-enable the connections: >/opt/IBM/informix/bin/onmode -m Helpful information: Jdbc… Continue reading Enable transactions on Informix DB

Bitronix configuration

After a first attempt to configure the JBoss transaction manager including  JMS, I finally decided to try the Bitronix transaction manager. Here is the detail of the configuration. First of all, you need to add the bitronix jars to your project, using Maven, it’s done very easily (unlike JBossTS, which needs a lot of different… Continue reading Bitronix 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