473,406 Members | 2,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

SQLObject connection/transaction blowing up

I'm trying to connect to a mysql database, with autoCommit and caching
off, and I'm trying to create a transaction. Why does this blow up?
from sqlobject import *
connectionString = 'mysql://admin@localhost/mc_image_library_dev?cache=&autoCommit='
connection = connectionForURI (connectionString)
sqlhub.processConnection = connection
oldConn = sqlhub.getConnection()
trans = oldConn.transaction()

Traceback (most recent call last):
File "<stdin>", line 1, in ?
File
"/usr/local/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/dbconnection.py",
line 354, in transaction
return Transaction(self)
File
"/usr/local/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/dbconnection.py",
line 722, in __init__
self._connection = dbConnection.getConnection()
File
"/usr/local/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/dbconnection.py",
line 226, in getConnection
conn = self.makeConnection()
File
"/usr/local/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/mysql/mysqlconnection.py",
line 49, in makeConnection
conn.autocommit(self.autoCommit)
TypeError: an integer is required

Jan 14 '06 #1
2 1838
ja*********@gmail.com wrote:
I'm trying to connect to a mysql database, with autoCommit and caching
off, and I'm trying to create a transaction. Why does this blow up? As the traceback is telling you, your connectionString is missing the
actual values. Not sure about the cache parameter but:
connectionString =
'mysql://admin@localhost/mc_image_library_dev?autoCommit=1' should work.

cheers
Paul
from sqlobject import *
connectionString = 'mysql://admin@localhost/mc_image_library_dev?cache=&autoCommit='
[snipp] conn.autocommit(self.autoCommit)
TypeError: an integer is required


Jan 14 '06 #2
No - I want autoCommit to be false. It defaults to true. SQLObject's
documentation says to leave the value blank for false, and to specify
any non-blank value for true.

Is the SQLObject documentation wrong? Should I specify autoCommit=0?

Jan 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: jacob.miles | last post by:
Hello. I'm trying to wrap a function call in a transaction, but when I intentionally throw an exception in the middle of the function it doesn't actually roll back the transaction. The debug...
0
by: Oleg Broytmann | last post by:
Hello! I'm pleased to announce the 0.7.1 release of SQLObject. What is SQLObject ================= SQLObject is an object-relational mapper. Your database tables are described as...
0
by: Oleg Broytmann | last post by:
Hello! I'm pleased to announce the 0.8.0b1 release of SQLObject. This is the first beta of the new branch. Taking into account that it is a result of rather large job the beta period will be...
0
by: Oleg Broytmann | last post by:
Hello! I'm pleased to announce the 0.8.0 release of SQLObject. What is SQLObject ================= SQLObject is an object-relational mapper. Your database tables are described as...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.