On Aug 21, 2007, at 5:25 PM, johnf wrote:

> As I read the code "crs.execute(sql, prm)" updates the db (and it  
> in fact it
> does update the data).  While doing so a transaction is started. I  
> assume
> that is true from Ed's prior statements on SQLite not needing a  
> "begin".  But
> when the "self._cursor.commitTransaction()" fires - I get an  
> error.  The
> error is there is no transaction started (as I reported in the earlier
> email).

        The code for 'self._cursor.commitTransaction()' reads:

def commitTransaction(self):
        """ Commit a SQL transaction."""
        ret = None
        if self.BackendObject:
                ret = self.BackendObject.commitTransaction(self.AuxCursor)
        return ret

        So this call is being passed to the BackendObject, which in this  
case is an instance of dbSQLite. Its commitTransaction() reads:

def commitTransaction(self, cursor):
        """ Commit a SQL transaction."""
        try:
                cursor.execute("COMMIT")
                dabo.dbActivityLog.write("SQL: commit")
        except Exception, e:
                if "no transaction is active" in str(e):
                        pass
                else:
                        dabo.dbActivityLog.write("SQL: commit failed: %s" % e)
                        raise dException.DBQueryException, e                    

This code will catch the case in which the transaction is not active,  
which is what you are reporting is not happening. If that's  
happening, you should be getting an entry in your dbActivityLog that  
says exactly what the error is. Please copy that log message in your  
reply so that I can see what sort of error you are running into.

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/dabo-dev/[EMAIL PROTECTED]

Reply via email to