commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Graeme" <...@tesco.net>
Subject RE: [DBCP] rollback not working with MySQL 4.1
Date Fri, 24 Jun 2005 06:50:58 GMT
Hi,

Bob you are spot on.  I created may table with the default MyISAM - will
recreate using InnoDB and retest.  

I took Dicks advice and wrote a test harness to test transactions (without
using DBCP) last night and it pointed to it being a MySQL problem.

Many thanks,
Graeme


Dirk Verbeeck wrote:
> Try the same test without using a pool to make sure MySQL
> is installed/configured correctly.
> If the standalone version works then please post a
> complete unit test showing the problem using BDCP. (also
> include version number of DBCP/MySQL) 

I didn't see the original post, but another thing to check is that 
The OP is using the correct type of table:

MyISAM - Very fast, disk based storage without support for transactions.
InnoDB - Transaction safe, disk based storage engine with row locking. 
         Recommended engine for tables that need support for transactions.

I would have thought that as MyISAM seems to be the default, that it
would automatically commit after each statement regardless of the value 
of autoCommit, thus resulting in roll back not working.

Cheers,

P.S. I could be talking out of my arse thought...

-- 
Bob Arnott


-----Original Message-----
From: Graeme [mailto:mrd@tesco.net] 
Sent: 22 June 2005 20:59
To: 'commons-user@jakarta.apache.org'
Subject: FW: [DBCP] rollback not working with MySQL 4.1


Hi,

I am having problems getting DBCP to rollback to work with MySQL.  Even
though I create the PoolableConnectionFactory with the constructor’s
parameter to create connection with defaultAutoCommit set to false

  i.e. PoolableConnectionFactory poolableConnectionFactory = new
PoolableConnectionFactory(connectionFactory,connectionPool,new
StackKeyedObjectPoolFactory(),null,false,false);

the program persists in committing after the execution of my INSERT
statement.  I also tried using forcing the autocommit to false via the
PoolableConnectionFactory’s setDefaultAutoCommit(false) method.  

Has anybody successfully used DBCP transactions with a MySQL database?  

Regards,
Graeme
   


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message