These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: set autocommit off is not longer suported - Spring + Hiberna
PostPosted: Tue Dec 20, 2005 9:15 am 
Newbie

Joined: Tue Dec 20, 2005 9:11 am
Posts: 2
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 20, 2005 9:41 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Go to the Spring forum.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 20, 2005 1:20 pm 
Newbie

Joined: Tue Dec 20, 2005 9:11 am
Posts: 2
I went.. but nothing yet.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.