PLEASE, HELP!
im starting whit spring and hibernate.... the hibernate properties are defined into applicationContext-hibernate.xml
------- applicationContext-hibernate.xml ------
<!-- Configurer that replaces ${...} placeholders with values from a properties file -->
<!-- (in this case, JDBC-related settings for the dataSource definition below) -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer">
<property name="location" value="/WEB-INF/hibernate.properties"/>
</bean>
<!-- Local DataSource that works in any environment -->
<!-- Note that DriverManagerDataSource does not pool; it is not intended for production -->
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverM anagerDataSource">
<property name="driverClassName" value="${jdbc.driverClassName}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
</bean>
<!-- Hibernate SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="mappingResources">
<list>
<value>user.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.generate_statistics">true</prop>
<prop key="hibernate.connection.autocommit">true</prop>
</props>
</property>
<property name="eventListeners">
<map>
<entry key="merge">
<bean class="org.springframework.orm.hibernate3.support. IdTransferringMergeEventListener"/>
</entry>
</map>
</property>
</bean>
--------------------------------------------
------------------ hibernate.properties ---------------------
# Properties file with JDBC-related settings.
# Applied by PropertyPlaceholderConfigurer
# from "applicationContext-hibernate.xml".
jdbc.driverClassName=org.postgresql.Driver
jdbc.url=jdbc:postgresql://150.162.27.56:5432/banco
jdbc.username=user
jdbc.password=senha
hibernate.dialect=org.hibernate.dialect.PostgreSQL Dialect
----------------------------------------
meanwhile, every time a transaction is executed (ex: getTemplate().doSave()), the error is thrown:
java.sql.SQLException: ERROR: SET AUTOCOMMIT TO OFF is no longer supported
I went to de PostgreSQL drive site (
http://jdbc.postgresql.org/download.html), and put it the drive (postgresql-8.0-314.jdbc3) in lib directory. But, when I start the TOMCAT, this happens:
19/12/2005 12:55:27 org.hibernate.cfg.SettingsFactory buildSettings
INFO: RDBMS: PostgreSQL, version: 8.0.3
19/12/2005 12:55:27 org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 7.3.4 JDBC3 jdbc driver build 113
I think so that TomCat was loading the wrong driver... how can I change this?????
How the SPRING wrap the hibernate, i dont know what to do... (when a try first without the SPRING, HIBERNATE have no problems).
PLEASE, i neeed HELP.
TANKS A LOT!
CARVO