PDO: test for transaction

PDO: test for transaction

am 14.09.2007 12:03:39 von puginews

I am using PDO for my MySQL database connection and actions.
I was wondering if it is possible to test if your are in a
transaction.
....
start transaction
....

call a function, can I test in this function if I am in the middle of
a transaction or not ?

....
end transaction
....

thanx,

Pugi!

Re: PDO: test for transaction

am 14.09.2007 13:23:47 von Friedemann Altrock

Pugi! schrieb:
> I am using PDO for my MySQL database connection and actions.
> I was wondering if it is possible to test if your are in a
> transaction.
> ...
> start transaction
> ...
>
> call a function, can I test in this function if I am in the middle of
> a transaction or not ?
>
> ...
> end transaction
> ...
>
> thanx,
>
> Pugi!
>

xpostings are not welcome, please dont do that again.
rtfm: http://de2.php.net/manual/en/function.PDO-beginTransaction.p hp

Re: PDO: test for transaction

am 14.09.2007 13:23:47 von Friedemann Altrock

Pugi! schrieb:
> I am using PDO for my MySQL database connection and actions.
> I was wondering if it is possible to test if your are in a
> transaction.
> ...
> start transaction
> ...
>
> call a function, can I test in this function if I am in the middle of
> a transaction or not ?
>
> ...
> end transaction
> ...
>
> thanx,
>
> Pugi!
>

xpostings are not welcome, please dont do that again.
rtfm: http://de2.php.net/manual/en/function.PDO-beginTransaction.p hp

Re: PDO: test for transaction

am 14.09.2007 13:53:19 von Jerry Stuckle

Friedemann Altrock wrote:
> Pugi! schrieb:
>> I am using PDO for my MySQL database connection and actions.
>> I was wondering if it is possible to test if your are in a
>> transaction.
>> ...
>> start transaction
>> ...
>>
>> call a function, can I test in this function if I am in the middle of
>> a transaction or not ?
>>
>> ...
>> end transaction
>> ...
>>
>> thanx,
>>
>> Pugi!
>>
>
> xpostings are not welcome, please dont do that again.
> rtfm: http://de2.php.net/manual/en/function.PDO-beginTransaction.p hp

xpostings are the recommended way to post on usenet when you need to
post to multiple groups.

And your response is shit.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: PDO: test for transaction

am 14.09.2007 13:53:19 von Jerry Stuckle

Friedemann Altrock wrote:
> Pugi! schrieb:
>> I am using PDO for my MySQL database connection and actions.
>> I was wondering if it is possible to test if your are in a
>> transaction.
>> ...
>> start transaction
>> ...
>>
>> call a function, can I test in this function if I am in the middle of
>> a transaction or not ?
>>
>> ...
>> end transaction
>> ...
>>
>> thanx,
>>
>> Pugi!
>>
>
> xpostings are not welcome, please dont do that again.
> rtfm: http://de2.php.net/manual/en/function.PDO-beginTransaction.p hp

xpostings are the recommended way to post on usenet when you need to
post to multiple groups.

And your response is shit.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: PDO: test for transaction

am 14.09.2007 13:57:06 von Jerry Stuckle

Pugi! wrote:
> I am using PDO for my MySQL database connection and actions.
> I was wondering if it is possible to test if your are in a
> transaction.
> ...
> start transaction
> ...
>
> call a function, can I test in this function if I am in the middle of
> a transaction or not ?
>
> ...
> end transaction
> ...
>
> thanx,
>
> Pugi!
>

Pugi,

No, there isn't any PDO (or other, for that matter) call I know of which
allows you to test if you are in a transaction or not. Probably because
there isn't any SQL query to do it.

But you also need to remember - MySQL will ignore transactions if you're
using MyISAM tables. So even if you could make such a call, it might
return incorrect information.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: PDO: test for transaction

am 14.09.2007 13:57:06 von Jerry Stuckle

Pugi! wrote:
> I am using PDO for my MySQL database connection and actions.
> I was wondering if it is possible to test if your are in a
> transaction.
> ...
> start transaction
> ...
>
> call a function, can I test in this function if I am in the middle of
> a transaction or not ?
>
> ...
> end transaction
> ...
>
> thanx,
>
> Pugi!
>

Pugi,

No, there isn't any PDO (or other, for that matter) call I know of which
allows you to test if you are in a transaction or not. Probably because
there isn't any SQL query to do it.

But you also need to remember - MySQL will ignore transactions if you're
using MyISAM tables. So even if you could make such a call, it might
return incorrect information.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: PDO: test for transaction

am 14.09.2007 14:02:46 von puginews

On 14 sep, 13:23, Friedemann Altrock
wrote:
> Pugi! schrieb:
>
>
>
> > I am using PDO for my MySQL database connection and actions.
> > I was wondering if it is possible to test if your are in a
> > transaction.
> > ...
> > start transaction
> > ...
>
> > call a function, can I test in this function if I am in the middle of
> > a transaction or not ?
>
> > ...
> > end transaction
> > ...
>
> > thanx,
>
> > Pugi!
>
> xpostings are not welcome, please dont do that again.
> rtfm:http://de2.php.net/manual/en/function.PDO-beginTransact ion.php

I do not see what is wrong with an xpost to a limit number of groups
(3) when the subject is appropriate and is not likely to cause a flame
war.
It sure beats multiposts.

By the way I rtfm before I posted my question.

Pugi!

Re: PDO: test for transaction

am 14.09.2007 14:02:46 von puginews

On 14 sep, 13:23, Friedemann Altrock
wrote:
> Pugi! schrieb:
>
>
>
> > I am using PDO for my MySQL database connection and actions.
> > I was wondering if it is possible to test if your are in a
> > transaction.
> > ...
> > start transaction
> > ...
>
> > call a function, can I test in this function if I am in the middle of
> > a transaction or not ?
>
> > ...
> > end transaction
> > ...
>
> > thanx,
>
> > Pugi!
>
> xpostings are not welcome, please dont do that again.
> rtfm:http://de2.php.net/manual/en/function.PDO-beginTransact ion.php

I do not see what is wrong with an xpost to a limit number of groups
(3) when the subject is appropriate and is not likely to cause a flame
war.
It sure beats multiposts.

By the way I rtfm before I posted my question.

Pugi!

Re: PDO: test for transaction

am 14.09.2007 14:19:13 von puginews

On 14 sep, 13:57, Jerry Stuckle wrote:
> Pugi! wrote:
> > I am using PDO for my MySQL database connection and actions.
> > I was wondering if it is possible to test if your are in a
> > transaction.
> > ...
> > start transaction
> > ...
>
> > call a function, can I test in this function if I am in the middle of
> > a transaction or not ?
>
> > ...
> > end transaction
> > ...
>
> > thanx,
>
> > Pugi!
>
> Pugi,
>
> No, there isn't any PDO (or other, for that matter) call I know of which
> allows you to test if you are in a transaction or not. Probably because
> there isn't any SQL query to do it.
>

I was afraid this would be the case. Would've made it easy, but there
are other ways to accomplish what I want to do.

> But you also need to remember - MySQL will ignore transactions if you're
> using MyISAM tables. So even if you could make such a call, it might
> return incorrect information.
>

This much I know. I use innodb.
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

Pugi!

Re: PDO: test for transaction

am 14.09.2007 14:19:13 von puginews

On 14 sep, 13:57, Jerry Stuckle wrote:
> Pugi! wrote:
> > I am using PDO for my MySQL database connection and actions.
> > I was wondering if it is possible to test if your are in a
> > transaction.
> > ...
> > start transaction
> > ...
>
> > call a function, can I test in this function if I am in the middle of
> > a transaction or not ?
>
> > ...
> > end transaction
> > ...
>
> > thanx,
>
> > Pugi!
>
> Pugi,
>
> No, there isn't any PDO (or other, for that matter) call I know of which
> allows you to test if you are in a transaction or not. Probably because
> there isn't any SQL query to do it.
>

I was afraid this would be the case. Would've made it easy, but there
are other ways to accomplish what I want to do.

> But you also need to remember - MySQL will ignore transactions if you're
> using MyISAM tables. So even if you could make such a call, it might
> return incorrect information.
>

This much I know. I use innodb.
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

Pugi!

Re: PDO: test for transaction

am 14.09.2007 15:02:27 von Michael Fesser

..oO(Pugi!)

>I am using PDO for my MySQL database connection and actions.
>I was wondering if it is possible to test if your are in a
>transaction.
>...
>start transaction
>...
>
>call a function, can I test in this function if I am in the middle of
>a transaction or not ?
>
>...
>end transaction
>...

You could extend the PDO class and implement your own
beginTransaction(), commit() and rollback() methods with some
transaction counter or something like that.

Micha

Re: PDO: test for transaction

am 14.09.2007 15:02:27 von Michael Fesser

..oO(Pugi!)

>I am using PDO for my MySQL database connection and actions.
>I was wondering if it is possible to test if your are in a
>transaction.
>...
>start transaction
>...
>
>call a function, can I test in this function if I am in the middle of
>a transaction or not ?
>
>...
>end transaction
>...

You could extend the PDO class and implement your own
beginTransaction(), commit() and rollback() methods with some
transaction counter or something like that.

Micha