main logo
Subject: [dabo-dev] dabo Commit 3014
Author: Uwe Grauer
Posted: 2007/03/31 17:21:07
 
View Entire Thread
New Search


dabo Commit
Revision 3014
Date: 2007-03-31 15:21:07 -0700 (Sat, 31 Mar 2007)
Author: Uwe_Grauer
Trac: http://svn.dabodev.com/trac/dabo/changeset/3014

Changed:
U trunk/dabo/db/dBackend.py
U trunk/dabo/db/dbFirebird.py

Log:
enhancements for dbActivityLog


Diff:
Modified: trunk/dabo/db/dBackend.py
===================================================================
--- trunk/dabo/db/dBackend.py 2007-03-31 19:26:26 UTC (rev 3013)
+++ trunk/dabo/db/dBackend.py 2007-03-31 22:21:07 UTC (rev 3014)
@@ -219,11 +219,13 @@
""" Commit a SQL transaction."""
if not cursor.AutoCommit:
self._connection.commit()
+ dabo.dbActivityLog.write("SQL: commit")


def rollbackTransaction(self, cursor):
""" Roll back (revert) a SQL transaction."""
self._connection.rollback()
+ dabo.dbActivityLog.write("SQL: rollback")


def addWithSep(self, base, new, sep=",\n\t"):

Modified: trunk/dabo/db/dbFirebird.py
===================================================================
--- trunk/dabo/db/dbFirebird.py 2007-03-31 19:26:26 UTC (rev 3013)
+++ trunk/dabo/db/dbFirebird.py 2007-03-31 22:21:07 UTC (rev 3014)
@@ -1,5 +1,6 @@
import datetime
import re
+import dabo
from dabo.dLocalize import _
from dBackend import dBackend
from dCursorMixin import dCursorMixin
@@ -50,11 +51,11 @@
password=password, database=database)
return self._connection

-
+
def getDictCursorClass(self):
return self.dbapi.Cursor

-
+
def noResultsOnSave(self):
""" Firebird does not return the number of records updated, so
we just have to ignore this, since we can't tell a failed save apart
@@ -189,11 +190,19 @@
return tuple(fields)


+ def beginTransaction(self, cursor):
+ """ Begin a SQL transaction."""
+ if not cursor.connection._has_transaction():
+ cursor.connection.begin()
+ dabo.dbActivityLog.write("SQL: begin")
+
+
def flush(self, cursor):
""" Firebird requires an explicit commit in order to have changes
to the database written to disk.
"""
cursor.connection.commit()
+ dabo.dbActivityLog.write("SQL: commit")


def getLimitWord(self):





 
©2007 Uwe Grauer
<-- Prior Message New Search Next Message -->