Here are the model and the short test program:

class System(SQLObject):
        _cacheValue = False

        class sqlmeta:
                table ='ships.systems'
                idName ='system_id'
        name = StringCol(dbName="system_name",alternateID=True,notNone=True)

===============================================

[iseegc@www iseegc]$ tg-admin shell
Python 2.4.1 (#1, Dec  4 2005, 16:28:22)
Type "copyright", "credits" or "license" for more information.

In [1]: System(name="Hyperdrive") #notice the id of 4
Out[1]: <System 4L name='Hyperdrive'>

In [2]: System._connection.autoCommit #notice auto commit is true
Out[2]: True

In [3]: # CTRL-D to quit ipython
[iseegc@www iseegc]$ tg-admin shell
Python 2.4.1 (#1, Dec  4 2005, 16:28:22)
Type "copyright", "credits" or "license" for more information.

In [1]: System.get(4)
---------------------------------------------------------------------------
sqlobject.main.SQLObjectNotFound                         Traceback (most recent call last)

/home/iseegc/iseegc/<console>

/usr/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/main.py in get(cls, id, connection, selectResults)
    906                 val = cls(_SO_fetch_no_create=1)
    907                 val._SO_validatorState = SQLObjectState(val)
--> 908                 val._init(id, connection, selectResults)
    909                 cache.put(id, cls, val)
    910             finally:

/usr/lib/python2.4/site-packages/SQLObject-0.7.0-py2.4.egg/sqlobject/main.py in _init(self, id, connection, selectResults)
    944             selectResults = self._connection._SO_selectOne(self, dbNames)
    945             if not selectResults:
--> 946                 raise SQLObjectNotFound, "The object %s by the ID %s does not exist" % (self.__class__.__name__, self.id)
    947         self._SO_selectInit(selectResults)
    948         self._SO_createValues = {}

SQLObjectNotFound: The object System by the ID 4 does not exist

In [2]: [i for i in System.select()]        #as you can see, we added "Hyperdrive" but it wasn't committed
Out[2]: [<System 2 name='Gravity Well'>]

In [3]: System(name = "Hyperdrive") #lets try to add it again
Out[3]: <System 5L name='Hyperdrive'>

In [4]: System._connection.commit()
In [5]: #now I hit CTRL+D to quit interpreter

[iseegc@www iseegc]$ tg-admin shell
Python 2.4.1 (#1, Dec  4 2005, 16:28:22)
Type "copyright", "credits" or "license" for more information.

In [1]: System.get(5) #aha, now it works because it was committed
Out[1]: <System 5 name='Hyperdrive'>

In [2]:

====================================

So even though autoCommit is on, it doesn't commit anything.

-Igor

p.s. using sqlobject 0.7.0 py2.4 egg

On 12/30/05, Oleg Broytmann <phd@mail2.phd.pp.ru> wrote:
On Fri, Dec 30, 2005 at 12:48:22AM -0600, Igor Murashkin wrote:
> I'm using PostgreSQL 8.0, and even when I turn off caching by adding
> _cacheValue = False to my model, it still won't commit automatically. If I
> don't explicitly call commit() or rollback() I will just end up with an
> error. I am using sqlobject 7.0, I was wondering if autoCommit is broken?

   Please show a short test program and the error...

Oleg.
--
     Oleg Broytmann            http://phd.pp.ru/            phd@phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss