Hi Tod, thanks for your answer.

I changed the code to this

Q->SQL->Clear();
Q->SQL->Add("SET AUTOCOMMIT=0");
Q->ExecSQL();


Q->SQL->Clear();
Q->SQL->Add("BEGIN");
Q->ExecSQL();

Q->SQL->Clear();
Q->SQL->Add("INSERT INTO regn_info VALUES('t1','test1')");
Q->ExecSQL();

Q->SQL->Clear();
Q->SQL->Add("INSERT INTO regn_info VALUES('t2','test2')");
Q->ExecSQL();

Q->SQL->Clear();
Q->SQL->Add("ROLLBACK");
Q->ExecSQL();

And now for the ODBC connection is working fine, but the same code using
TSQLQuery (dbExpress Component) dosen't work. Do you have any idea what can
be the reason?

Thanks

Javier 



-----Original Message-----
From: Tod Harter [mailto:[EMAIL PROTECTED]]
Sent: 02 September 2002 15:58
To: Javier Diaz
Subject: Re: Inno DB Question


On Monday 02 September 2002 07:37 am, you wrote:

I would think you would want to set autocommit BEFORE you call "BEGIN" since

that starts your transaction. My guess would be that setting autocommit 
clears any existing transaction.  In the case without the begin and 
autocommit set to 0 I don't really know what is going to happen... 
Essentially you're telling the database "I'll tell you when to create a 
transaction" and then you don't create one. I can only assume the behaviour 
is that mysql goes back to the 'autocommit 1' state at that point since 
otherwise whatever you're doing makes no sense. 

> Hi all,
>
> I'm using MySQL 4.0.2 alpha-max with Inno DB and Borland Builder 6.0 to
> connect to MySQL. I'm trying to use the new dbExpress component for
Borland
> to connect to MySQL using the libmysql.dll
>
> I have been making some tests with transactions using the dbExpress
> components and the normal ODBC but I can't get the ROLLBACK function to
> work.
> Here are some examples:
>
> using dbExpress
>
> TSQLConnection Q;
> Q= new TSQLQuery(Application);
> Q->SQLConnection=SQLConnection1;
>
> /* I test with and without BEGIN
> Q->SQL->Clear();
> Q->SQL->Add("BEGIN");
> Q->ExecSQL();
> */
>
> Q->SQL->Clear();
> Q->SQL->Add("SET AUTOCOMMIT=0");
> Q->ExecSQL();
>
> Q->SQL->Clear();
> Q->SQL->Add("INSERT INTO regn_info VALUES('t1','test1')");
> Q->ExecSQL();
>
>
> Q->SQL->Clear();
> Q->SQL->Add("INSERT INTO regn_info VALUES('t2','test2')");
> Q->ExecSQL();
>
> Q->SQL->Clear();
> Q->SQL->Add("ROLLBACK");
> Q->ExecSQL();
>
> //----------------------------------------------------------
> Using ODBC
>
>
> TQuery *Q_ODBC;
> Q_ODBC= new TQuery(Application);
> Q_ODBC->DatabaseName="salsadb";
>
> /*
> Q->SQL->Clear();
> Q->SQL->Add("BEGIN");
> Q->ExecSQL();
> */
>
> Q_ODBC->SQL->Clear();
> Q_ODBC->SQL->Add("SET AUTOCOMMIT=0");
> Q_ODBC->ExecSQL();
>
> Q_ODBC->SQL->Clear();
> Q_ODBC->SQL->Add("INSERT INTO regn_info VALUES('t1','test1')");
>
> Q_ODBC->ExecSQL();
>
>
> Q_ODBC->SQL->Clear();
> Q_ODBC->SQL->Add("INSERT INTO regn_info VALUES('t2','test2')");
> Q_ODBC->ExecSQL();
>
> Q_ODBC->SQL->Clear();
> Q_ODBC->SQL->Add("ROLLBACK");
> Q_ODBC->ExecSQL();
>
> In both cases the ROLLBACK dosen't work and I get the inserted values in
> the table.
>
> Any idea what can be happening?
>
> Thanks a lot
>
> Javier Diaz
>
>
>
> ------------------------------
>
> This e-mail is intended for the named addressee only.  It may contain
> confidential and/or privileged information.  If you have received this
> message in error, please let us know and then delete this message from
your
> system.  You should not copy the message, use it for any purpose or
> disclose its contents to anyone.
>
>
> ________________________________________________________________________
> This e-mail has been scanned for all viruses by Star Internet. The
> service is powered by MessageLabs. For more information on a proactive
> anti-virus service working around the clock, around the globe, visit:
> http://www.star.net.uk
> ________________________________________________________________________
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]> Trouble
> unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


------------------------------

This e-mail is intended for the named addressee only.  It may contain confidential 
and/or privileged information.  If you have received this message in error, please let 
us know and then delete this message from your system.  You should not copy the 
message, use it for any purpose or disclose its contents to anyone.


________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to