Announcement Announcement Module
Collapse
No announcement yet.
Hibernate transaction configuration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hibernate transaction configuration

    Hi all,
    I am trying to configure spring 3.1 with hibernate and i want to use declarative transactions. Initially i was using hibernate 3.1.x, however, while executing @tractional method i got exception as
    Code:
    java.lang.NoSuchFieldError: MANUAL
    	org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:530)
    	org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:371)
    	org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:335)
    	org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:105)
    	org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    So later I upgraded to "hibernate 3.2.x-CR2.jar", but now i m getting "java.lang.NoClassDefFoundError: org/hibernate/loader/custom/SQLQueryReturn" while initializing sessionFactory.

    Code:
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
    	<property name="dataSource" ref="dataSource" /> 
    	<property name="annotatedClasses">
    		<list>
      			...	  			
    		</list>
    	</property>
    	<property name="hibernateProperties">
    		<props>
      			... 
      		</props>
      	</property>
     </bean>
    		
    <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
      	<property name="sessionFactory" ref="sessionFactory" />
    </bean>
    		
    <tx:annotation-driven transaction-manager="txManager"/>
    Code:
    @Transactional(readOnly = true)
    public interface ProductService {
    	
    	@Transactional(readOnly = false, propagation = Propagation.REQUIRED)
    	public void saveProduct(Product product) throws ApplicationException;
    }
    Please let me know which jar versions should i use?
Working...
X