Results 1 to 2 of 2

Thread: Declarative transaction management with Hibernate

  1. #1
    Join Date
    Oct 2004
    Location
    Paris (France)
    Posts
    26

    Default Declarative transaction management with Hibernate

    I'm using the new spring declarative transaction management with hibernate3 in my application.
    I've a little doubt about the right transaction manager to choose.
    For the instance I'm using
    Code:
    org.springframework.orm.hibernate3.HibernateTransactionManager
    I have a single hibernate session factory for all my daos.

    Every things work fine (or seem to work fine). I'm just a little bit troubled by the SQL WARNING below:
    Code:
    0:33:18,296 WARN  [JDBCExceptionReporter] SQL Warning: 0, SQLState: 010SK
    10:33:18,296 WARN  [JDBCExceptionReporter] 010SK: La base de données ne peut pas définir l'option de connexion SET_READONLY_TRUE.
    10:33:18,296 WARN  [JDBCExceptionReporter] SQL Warning: 0, SQLState: 010SK
    10:33:18,296 WARN  [JDBCExceptionReporter] 010SK: La base de données ne peut pas définir l'option de connexion SET_READONLY_FALSE.
    10:33:18,343 WARN  [JDBCExceptionReporter] SQL Warning: 0, SQLState: 010SK
    10:33:18,343 WARN  [JDBCExceptionReporter] 010SK: La base de données ne peut pas définir l'option de connexion SET_READONLY_TRUE.
    10:33:18,343 WARN  [JDBCExceptionReporter] SQL Warning: 0, SQLState: 010SK
    10:33:18,343 WARN  [JDBCExceptionReporter] 010SK: La base de données ne peut pas définir l'option de connexion SET_READONLY_FALSE.
    I would like to know if it's "normal" to have this warning.
    I'd also like to have an advice about the right transaction manager to choose
    between
    org.springframework.transaction.jta.JtaTransaction Manager and org.springframework.orm.hibernate3.HibernateTransa ctionManager

    here is my spring config file:
    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:aop="http://www.springframework.org/schema/aop"
    		xmlns:tx="http://www.springframework.org/schema/tx"
    		xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
    				http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
    				http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
    
    	
         <bean id="mediaTxManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        	<property name="sessionFactory" ref="mediaSessionFactory"/>
      	</bean>
      	
      	<aop:config>
        <aop:pointcut id="service" expression="execution(* com.natixis.media.services.*.*(..))"/>
        <aop:advisor advice-ref="txAdvice" pointcut-ref="service"/>
        </aop:config>
       
        
        <tx:advice id="txAdvice" transaction-manager="mediaTxManager">
        <tx:attributes>
          <tx:method name="find*" read-only="true"/>
          <tx:method name="*" propagation="REQUIRED"/>   
        </tx:attributes>
      </tx:advice>
         
         <bean id="articleService" class="com.natixis.media.services.ArticleServiceImpl">
             <property name="articleDao" ref="articleDAOHibernate"/>
             <property name="supportDao" ref="supportDAOHibernate"/>
             <property name="categorieDao" ref="categorieDAOHibernate"/>
         </bean>
        
    </beans>
    any help is appreciated.
    Meissa

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    It's a warning stating that your database doesn't support read-only transactions. According to the spec the database might do something with read-only but doesn't force it to. So the warning indicates merely your DB doesn't do anything with the readonly attribute.

    To get rid of the warning, remove the readonly attribute on your transaction definition.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •