You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Eugeny N Dzhurinsky <eu...@jdevelop.com> on 2005/08/18 08:16:28 UTC

transaction rollback

Hi
I'm trying to rollback the transaction with SqlMapClient.
the source looks like

client.startTransaction();
//some insert/select calls
client.endTransaction();

the inserted data remains in the table, but is shouldn't (it's unit-test)
there is MySQL at the backend.
Any ideas?

-- 
Eugene N Dzhurinsky

Re: transaction rollback

Posted by Oleg Shpak <ol...@rap-x.com>.
Eugeny,

make sure you are using a table type which supports transactions such as 
InnoDB.

A statement like below can show you which type/engine you are using

show create table <tablename>;

it outputs the following:

CREATE TABLE <tablename> (
...
) Type=InnoDB ... ;
(or ENGINE=InnoDB for MySQL 4.1).

If the type is MyISAM then rollback just does nothing.

If you specify InnoDB type explicitly when creating tables, but they get 
MyISAM type then check you my.ini/my.cnf file and comment out 
'skip-innodb' line.
Consult on-line doc for detailed documentation about configuration of 
InnoDB engine.

Regards,
Oleg


Eugeny N Dzhurinsky wrote:

>Hi
>I'm trying to rollback the transaction with SqlMapClient.
>the source looks like
>
>client.startTransaction();
>//some insert/select calls
>client.endTransaction();
>
>the inserted data remains in the table, but is shouldn't (it's unit-test)
>there is MySQL at the backend.
>Any ideas?
>
>  
>