problème avec l’enregistrement des données dans ma base
salut les amis
j'utilise oracle et hibernate avec spring et struts mais quand je fais un save() les données ne s’enregistrent pas dans ma base instantanément. c'est juste quand je change mon fichier .hbm pour faire des changement sur la génération de l'id que les données apparaissent !!! et comme ça encore une fois juste après le prochaine save() il n'apparaissent pas !!!
donc le problème c'e quand j’exécute le save() je check ma base de donnée il y a rien.
voici mes configurations :
autentification.hbm.xml :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| <hibernate-mapping>
<class name="POJOs.Autentification" table="AUTENTIFICATION" schema="WS" >
<id name="id" type="int">
<column name="ID"/>
<generator class="increment"/>
</id>
<property name="login" type="string">
<column name="LOGIN" length="30" />
</property>
<property name="password" type="string">
<column name="PASSWORD" length="30" />
</property>
</class>
</hibernate-mapping> |
l'appel de save dans la fonction execute() de struts dans le form action :
Code:
wsservice.addUser(new Autentification(logfrm.getLogin(),logfrm.getPassword()));
applicationContext.xml de spring :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| <?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.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<bean id="WsService"
class="DamService.WsServiceImp" >
<property name="wsdao" ref="wsdao" />
</bean>
<bean id="wsdao"
class="DamDAO.WsDaoImp" >
<property name="hibernateTemplate" ref="hibernateTemplate"></property>
</bean>
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation" value="classpath:hibernate.cfg.xml">
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean name="/LoginAction" class="Struts.LoginAction">
<property name="wsservice" ref="WsService"></property>
</bean>
</beans> |