I'm using SQLite3, with pretty much the default setup. In fact, I just created a new project using quickstart, my dbiurl is:

sqlobject.dburi="sqlite:///Users/jeff/Sites/turbo/transaction/test.db"

My entire model.py file is:

from sqlobject import *
from turbogears.database import PackageHub

hub = PackageHub("transaction")
__connection__ = hub

class Test(SQLObject):
    s = StringCol( length=100 )


I then created an instance:

miles:~/Sites/turbo/transaction> tg-admin shell
Python 2.4.1 (#2, Mar 31 2005, 00:05:10)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> t= Test(s="foo")
>>>

And tried to create a connection using an instance

miles:~/Sites/turbo/transaction> tg-admin shell
Python 2.4.1 (#2, Mar 31 2005, 00:05:10)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> t= Test.get(1)
>>> t._connection.transaction().begin()
Traceback (most recent call last):
  File "<console>", line 1, in ?
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/ dbconnection.py", line 809, in begin assert self._obsolete, "You cannot begin a new transaction session without rolling back this one" AssertionError: You cannot begin a new transaction session without rolling back this one



On 30 Oct, 2005, at 11:45 pm, william wrote:

Just to be able to reproduce it, what are your declaration parameters
and which DB/connector are you using ?

Have you see that by default SQLObject enable the autoCommit?

http://www.sqlobject.org/SQLObject.html#declaring-the-class


--
Jeff Watkins
http://metrocat.org/


Reply via email to