BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

bad working of transaction with mysql

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (dbExpress)
View previous topic :: View next topic  
Author Message
opa
Guest





PostPosted: Wed Sep 15, 2004 7:27 am    Post subject: bad working of transaction with mysql Reply with quote



hello,

I've got a transaction that includes some TSQLQuery applyUpdates with MySql
4.1.1-gama-nt version. If one of them fails, I realize changes are not
rolledback. Does any body know what is happening?, and how can I solve the
problem? I need transaction works of course; having this is the same as
having a no transaction application.

give me a solution please.

thanks very much.

opa


Back to top
Dmitry Arefiev [gs-soft.r
Guest





PostPosted: Thu Sep 16, 2004 6:24 am    Post subject: Re: bad working of transaction with mysql Reply with quote



Hello !

Few reasons are possible:

1) Do you use InnoDB or BDB as table type ? Default MyISAM
table type is not under transaction control.

2) MySQL dbExpress driver clones a connections to have few
queries in prepared state in the same time. And TX control goes
just through first (main) connection.

Regards,
Dmitry

--
Dmitry Arefiev, gs-soft Company, community.gs-soft.com
Personal - www.da-soft.com

SAPx - Delphi to SAP R/3 direct access
Saphir - SAP R/3 metadata on your fingertips
MetaBase - ERWIN model in Delphi applications
NCOCI8 - Freeware Delphi to ORACLE direct access

opa wrote:
Quote:
hello,

I've got a transaction that includes some TSQLQuery applyUpdates with MySql
4.1.1-gama-nt version. If one of them fails, I realize changes are not
rolledback. Does any body know what is happening?, and how can I solve the
problem? I need transaction works of course; having this is the same as
having a no transaction application.

give me a solution please.

thanks very much.

opa

Back to top
opa
Guest





PostPosted: Thu Sep 16, 2004 6:28 am    Post subject: Re: bad working of transaction with mysql Reply with quote



Hi Dimitry,

yes, I use InnoDB tables. Any solution??

thanks.

opa.

"Dmitry Arefiev [gs-soft.ru]" <darefiev (AT) gs-soft (DOT) ru> escribio en el mensaje
news:41493096 (AT) newsgroups (DOT) borland.com...
Quote:
Hello !

Few reasons are possible:

1) Do you use InnoDB or BDB as table type ? Default MyISAM
table type is not under transaction control.

2) MySQL dbExpress driver clones a connections to have few
queries in prepared state in the same time. And TX control goes
just through first (main) connection.

Regards,
Dmitry

--
Dmitry Arefiev, gs-soft Company, community.gs-soft.com
Personal - www.da-soft.com

SAPx - Delphi to SAP R/3 direct access
Saphir - SAP R/3 metadata on your fingertips
MetaBase - ERWIN model in Delphi applications
NCOCI8 - Freeware Delphi to ORACLE direct access

opa wrote:
hello,

I've got a transaction that includes some TSQLQuery applyUpdates with
MySql
4.1.1-gama-nt version. If one of them fails, I realize changes are not
rolledback. Does any body know what is happening?, and how can I solve
the
problem? I need transaction works of course; having this is the same as
having a no transaction application.

give me a solution please.

thanks very much.

opa



Back to top
Tim
Guest





PostPosted: Mon Sep 20, 2004 2:56 pm    Post subject: Re: bad working of transaction with mysql Reply with quote


"opa" <opa (AT) yahoo (DOT) com> wrote

Quote:
Hi Dimitry,

yes, I use InnoDB tables. Any solution??

DBExpress does not handle transactions properly with the standard MySQL
dll's, as I have taken weeks of messing about to discover. You need to get
third party drivers, such as http://www.crlab.com/products.html or
http://microolap.com/dbx/mysql/index.htm. Both of these work fine.

Tim



Back to top
opa
Guest





PostPosted: Tue Sep 21, 2004 9:38 am    Post subject: Re: bad working of transaction with mysql Reply with quote

Hi Tim,

but, do you think everybody who is working with standard dll's has no
transaction in their applications ¿?

anyway thanks for you help.


"Tim" <tim (AT) evolvedatasystems (DOT) co.uk> escribió en el mensaje
news:414eef69$1 (AT) newsgroups (DOT) borland.com...
Quote:

"opa" <opa (AT) yahoo (DOT) com> wrote in message
news:41493285 (AT) newsgroups (DOT) borland.com...
Hi Dimitry,

yes, I use InnoDB tables. Any solution??

DBExpress does not handle transactions properly with the standard MySQL
dll's, as I have taken weeks of messing about to discover. You need to get
third party drivers, such as http://www.crlab.com/products.html or
http://microolap.com/dbx/mysql/index.htm. Both of these work fine.

Tim





Back to top
Tim
Guest





PostPosted: Tue Sep 21, 2004 2:37 pm    Post subject: Re: bad working of transaction with mysql Reply with quote


"opa" <opa (AT) yahoo (DOT) com> wrote

Quote:
Hi Tim,

but, do you think everybody who is working with standard dll's has no
transaction in their applications ¿?

anyway thanks for you help.

Opa,

I was very puzzled for a while, but I found the problem in this way.

Create a table in MySQL and make sure it is InnoDB type. Use an SQLQuery to
INSERT INTO a value or two into the table and call SQLQuery1.ExecSQL.
Confirm that the value is inserted OK.

Now put the SQLQuery1.ExecSQL into a transaction with StartTransaction and
Commit and check that it works. Now instead of Commit at the end, use
RollBack and this should work OK.

For anyone who has only used single data objects within a single
transaction, it will have worked OK for them.

However...

Create two more tables, and use two other SQLQueries to INSERT data into
them. Now put all three - SQLQuery1.ExecSQL, SQLQuery2.ExecSQL and
SQLQuery3.ExecSQL - into a transaction with Commit at the end. And it works.

But, put RollBack at the end and only the FIRST query will be rolled back.
The others will NOT, which in my opinion makes the standard dll pretty
rubbish!

Tim



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (dbExpress) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.