Hi,
I'm using Spring 3.1.1.RELEASE, Hibernate 4.1.0.Final, JPA 2.0, and JBoss 7.1.1. I'm building a web application (WAR) and would like to sett an application-wide transaction timeout (without modifying my application server settings). I can't figure out how to configure this or determine if its possible. I've read some posts that suggests it doesn't work for Spring 2.5 and Hibernate 3.
I'm using the @Service annotation and marking those services as @Transactional.
Here's how I'm configuring my entity manager in my application context …
Here's my persistence.xml file …Code:<jee:jndi-lookup jndi-name="java:jboss/subco/myprojectpersistence" id="entityManagerFactory" expected-type="javax.persistence.EntityManagerFactory" /> <bean id="entityManager" class="org.springframework.orm.jpa.support.SharedEntityManagerBean"> <property name="entityManagerFactory" ref="entityManagerFactory"/> </bean> <tx:jta-transaction-manager />
Thanks for any guidance, - DaveCode:<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> <persistence-unit name="myprojectclientunit"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>java:jboss/datasources/MySqlDS</jta-data-source> <properties> <property name="hibernate.ejb.cfgfile" value="/hibernate.cfg.xml" /> <property name="jboss.entity.manager.factory.jndi.name" value="java:jboss/subco/myprojectpersistence" /> <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform" /> </properties> </persistence-unit> </persistence>


Reply With Quote
