bonjour,
Je veux accéder à la base de donnée à partir de mon IHM développée en JSf mais j'ai un problème de création de session d'hibernate.
Voici l'erreur qu'il me remonte:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
 
javax.faces.FacesException: #{testBean.test}: org.hibernate.HibernateException: Current transaction is not in progress
je travaille dans un environnement IBM: RSA 7.5.4 et WAS 6.1, je combine Spring 2.5.6 et Hibernate 3.3.2
Voici un extrait du code de mon fichier application-context-hbm.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
23
24
25
26
27
28
29
30
31
32
33
34
 
<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">
					org.hibernate.dialect.DB2Dialect
				</prop>
				<prop key="hibernate.show_sql">true</prop>
				<prop key="hibernate.connection.release_mode">
					auto
				</prop>
				<prop key="hibernate.current_session_context_class">
					org.hibernate.context.JTASessionContext
				</prop>
				<prop key="hibernate.transaction.manager_lookup_class">
					org.hibernate.transaction.WebSphereExtendedJTATransactionLookup
				</prop>
				<prop key="hibernate.transaction.factory_class">
					org.hibernate.transaction.JTATransactionFactory
 
				</prop>
 
				<prop key="jta.UserTransaction">
					java:comp/UserTransaction
				</prop>
 
				<prop key="hibernate.transaction.flush_before_completion">
					true
				</prop>
				<prop key="hibernate.transaction.auto_close_session">
					true
				</prop>
				<prop key="hibernate.max_fetch_depth">1</prop>
			</props>
		</property>
Voici un extrait du code de mon bean:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
public void test() {
 
 
		LoggingMessageDAO loggingMessageDAO = (LoggingMessageDAO) beanFactory.getBean("loggingMessageDao");
 
		list=loggingMessageDAO.findByLoggingMessage("9", "Erreur046");}