ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zarar.sidd...@utoronto.ca
Subject Re: can't update/insert to postgres db
Date Tue, 27 Sep 2005 01:49:55 GMT

Maybe autocommit is set to false. Try specifying it explicitly by putting
the following line in your <transactionManager> element.

<property name="JDBC.DefaultAutoCommit" value="true" />

On Mon, 26 Sep 2005, Ben Munat wrote:

> Hello. I can't seem to update or insert into a postgres db from ibatis. I don't get an
exception, but when I check the 
> database the change has not been made. I've tried various insert and update statements
with and without parameters and 
> none have worked. However, I am selecting data from this db with ibatis just fine.
> Here's some code I'm using:
> Reader reader = Resources.getResourceAsReader("sqlMap-config.xml");
> SqlClient sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader);
> int result = sqlMap.update("updateEmail",user);
> And from the sqlMap xml file:
> <statement id="updateEmail">
>      update user set email = 'buzz@boobah.com'
> </statement>
> (note: I had a where clause there but I'm trying to get it to do anything at this point!)
> I've also tried the "update" and "insert" sqlmap xml elements... and tried inserting
updating other tables too. And when 
> I run the exact same sql from a jdbc ui client, the database is updated sucessfully.
> Any ideas much appreciated.
> Ben

View raw message