Take the 2-minute tour ×

I'm using Jetty with mysql. I need some basic transaction support, and jetty is warning me at startup that no transaction manager is in use. I thought transactions were native to mysql? I'm trying something like:

Connection conn = ...;


// insert into table foo some data
// insert into table grok some data


If an exception is thrown between the two statements, I see that data has made its way into table "foo", so the transaction calls did not work.

So I guess we really do need a transaction manager here, am I understanding this correctly? If so, I was looking at bitronix: http://docs.codehaus.org/display/BTM/Home


share|improve this question

1 Answer 1

up vote 1 down vote accepted

Transactions are not "native" to MySQL (unlike other databases).

You need to make sure you are using the InnoDB storage engine, otherwise you won't be able to make use of transactions.

share|improve this answer
Ok, so I do in fact need an external transaction manager then, right? –  user291701 Feb 15 '11 at 23:36
No, just change your table to use InnoDB as the storage engine. This is all explained in detail in the MySQL manual. –  a_horse_with_no_name Feb 15 '11 at 23:37
Oh awesome, works! –  user291701 Feb 15 '11 at 23:54

Your Answer


