Hi,
I'm using Hibernate and Spring on WebSphere AS 7.0. I'm using this configuration and it seems working correctly, I'd want a confirm it is correct:
HTML Code:<?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" xmlns:jee="http://www.springframework.org/schema/jee" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd"> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location"> <value>classpath:database.properties</value> </property> </bean> <jee:jndi-lookup id="dataSource" jndi-name="${datasource_intranet_jndi}" cache="true" resource-ref="true" lookup-on-startup="false" proxy-interface="javax.sql.DataSource" /> <!-- Hibernate session factory --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource"/> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.Oracle8iDialect</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</prop> <prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</prop> </props> </property> <property name="mappingResources"> <list> <value>/hibernate-config/object.hbm.xml</value> </list> </property> </bean> <tx:annotation-driven transaction-manager="transactionManager"/> <bean id="transactionManager" class="org.springframework.transaction.jta.WebSphereUowTransactionManager" /> <!-- DAO --> <bean id="objectDAO" class="mypackage.ObjectDAOImpl" > <property name="sessionFactory" ref="sessionFactory"></property> </bean> </beans>


Reply With Quote