Are you using a version of MySQL that supports transactions?
Gareth Coltman wrote:
>
> HELP!
>
> I am trying to use transactional control but having no joy. I am using the
> JDBC mysql driver. here is some of my code (summary of course)
>
> public void doStage5( RunData data, Context context ) throws Exception
> {
> ParameterParser pp = data.getParameters();
> DBConnection dbCon = null;
>
> try
> {
> dbCon =
>BasePeer.beginTransaction(TurbinePoolBrokerService.DEFAULT);
>
> // Create the personal details criteria
> Object holderId = HolderPeer.doInsert(holderCrit, dbCon);
> Object addressId = AddressPeer.doInsert(addressCrit, dbCon);
>
> // Create a new user
> createNewUser(data, pensionHolderId);
>
> // Notify new user
> notifyNewUser(data, context);
>
> // Commit!
> BasePeer.commitTransaction (dbCon);
> }
> catch(Exception e)
> {
> BasePeer.rollBackTransaction (dbCon);
> System.out.println("Rollback performed!");
> System.out.println("An exception occurred!\nException
>Details: " + e);
> }
> }
>
> Everything is working fine, but the rollback simply doesn't rollback! I have
> tried setting autocommit to false manually.
>
> Gareth
>
> ------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?: [EMAIL PROTECTED]
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]