salut

avec spring 2.5.2 je voudrais activer les transactions....

voici la config xml
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
<!-- the transactional advice (what 'happens'; see the <aop:advisor/> bean below) -->
   <tx:advice id="txAdvice" transaction-manager="txManager">
   <!-- the transactional semantics... -->
   <tx:attributes>
    <!-- all methods starting with 'get' are read-only -->
        <tx:method name="get*" read-only="true"/>
        <!-- other methods use the default transaction settings (see below) -->
       <tx:method name="*"/>
   </tx:attributes>
</tx:advice>
 
<!-- Transaction manager for a single JDBC DataSource -->
<!-- (see dataAccessContext-jta.xml for an alternative) -->
<bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  <property name="dataSource" ref="dataSource"/>
</bean>
 
  <aop:config>
    <aop:pointcut id="transactionSpring" expression="execution(* *..GroupFacade.*(..))"/>
    <aop:advisor advice-ref="txAdvice" pointcut-ref="transactionSpring"/>
 </aop:config>
Il y a insertion d'un group dans la bd, ça fonctionne bien...

comment savoir que la gestion de la transaction a bien lieu?
car j'ai aucun message me disant que la transaction a bien eu lieu... et j'ai pas d'erreur

addGroup est une méthode dans l'interface GroupFacade

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
 
public long addGroup(GroupInfo groupInfo) throws GroupException{
...
...
}
NestedCheckedException provient de spring
GroupException extends NestedCheckedException implements ErrorCoded

j'appèle cette méthode via une application web

comment faire pour qu'un rollback est lieu automatiquement s'il y a un problème?

comment testé ce cas là... d'utilisation du rollback?


merci