MySQLdb begin() -

2006-04-25 Thread shearichard
Hi - Feeling a bit weird about this but I cannot find the 'begin'
method on a connection object of MySQLdb. Can anyone explain why ?

I'm using version 1.2.0 which is pretty recent and I've read that
'begin' should be a method of connection but it's not there ! Feeling
pretty puzzled !

Below are the details of what I see ...


 import MySQLdb
 c= MySQLdb.Connect(host='localhost', user='a',passwd='b', db='c',compress=1)
 c.begin()
Traceback (most recent call last):
  File stdin, line 1, in ?
AttributeError: 'Connection' object has no attribute 'begin'
 o=MySQLdb
 o.__version__
'1.2.0'
 o.__revision__
'1.37'
 o.apilevel
'2.0'


Be interested in any comments.

regards

Richard.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: MySQLdb begin() -

2006-04-25 Thread Geoffrey Clements
[EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi - Feeling a bit weird about this but I cannot find the 'begin'
 method on a connection object of MySQLdb. Can anyone explain why ?

 I'm using version 1.2.0 which is pretty recent and I've read that
 'begin' should be a method of connection but it's not there ! Feeling
 pretty puzzled !


What exactly do you expect a begin method to do?  Have you read this:
http://www.python.org/dev/peps/pep-0249/

-- 
Geoff 


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: MySQLdb begin() -

2006-04-25 Thread shearichard
What do i expect the begin method to do ?

Explicitly start a transaction (and therefore suppress autocommits) in
an environment where autocommit is on.

No i haven't read the pep, thanks for that.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: MySQLdb begin() -

2006-04-25 Thread shearichard
Thanks for your advice. In fact subsquent to posting I started using
...

conn.autocommit = False

... as a synonm for ...

conn.begin()

... and as you say that does the job. (Sorry i should have said it's
not practicable to turn off autocommit always [or rather it may be but
I'm not about to shake the boat to that extent just now ;-]

As to what I was reading yes it's here ...

http://www.devshed.com/index2.php?option=contenttask=viewid=210pop=1page=0hide_js=1

... or more succinctly ...

http://tinyurl.com/s6yd2

... page down to ...

connection.begin() - start a transaction

... that article refers to version 0.92 of MySQLdb so clearly it was
either wrong then or for some weird reason the method has been dropped.

thanks again.

richard.

-- 
http://mail.python.org/mailman/listinfo/python-list