Index: /pykota/trunk/pykota/storage.py
===================================================================
--- /pykota/trunk/pykota/storage.py (revision 2773)
+++ /pykota/trunk/pykota/storage.py (revision 2801)
@@ -108,18 +108,12 @@
     def delete(self) :    
         """Deletes an user from the database."""
-        self.parent.beginTransaction()
-        try :
-            self.parent.deleteUser(self)
-        except PyKotaStorageError, msg :    
-            self.parent.rollbackTransaction()
-            raise PyKotaStorageError, msg
-        else :    
-            self.parent.commitTransaction()
-            self.parent.flushEntry("USERS", self.Name)
-            if self.parent.usecache :
-                for (k, v) in self.parent.caches["USERPQUOTAS"].items() :
-                    if v.User.Name == self.Name :
-                        self.parent.flushEntry("USERPQUOTAS", "%s@%s" % (v.User.Name, v.Printer.Name))
-            self.Exists = 0
+        self.parent.deleteUser(self)
+        self.parent.flushEntry("USERS", self.Name)
+        if self.parent.usecache :
+            for (k, v) in self.parent.caches["USERPQUOTAS"].items() :
+                if v.User.Name == self.Name :
+                    self.parent.flushEntry("USERPQUOTAS", "%s@%s" % (v.User.Name, v.Printer.Name))
+        self.Exists = False
+        self.isDirty = False            
         
 class StorageGroup(StorageObject) :        
@@ -152,18 +146,12 @@
     def delete(self) :    
         """Deletes a group from the database."""
-        self.parent.beginTransaction()
-        try :
-            self.parent.deleteGroup(self)
-        except PyKotaStorageError, msg :    
-            self.parent.rollbackTransaction()
-            raise PyKotaStorageError, msg
-        else :    
-            self.parent.commitTransaction()
-            self.parent.flushEntry("GROUPS", self.Name)
-            if self.parent.usecache :
-                for (k, v) in self.parent.caches["GROUPPQUOTAS"].items() :
-                    if v.Group.Name == self.Name :
-                        self.parent.flushEntry("GROUPPQUOTAS", "%s@%s" % (v.Group.Name, v.Printer.Name))
-            self.Exists = 0
+        self.parent.deleteGroup(self)
+        self.parent.flushEntry("GROUPS", self.Name)
+        if self.parent.usecache :
+            for (k, v) in self.parent.caches["GROUPPQUOTAS"].items() :
+                if v.Group.Name == self.Name :
+                    self.parent.flushEntry("GROUPPQUOTAS", "%s@%s" % (v.Group.Name, v.Printer.Name))
+        self.Exists = False
+        self.isDirty = False            
         
 class StoragePrinter(StorageObject) :
@@ -226,22 +214,15 @@
     def delete(self) :    
         """Deletes a printer from the database."""
-        self.parent.beginTransaction()
-        try :
-            self.parent.deletePrinter(self)
-        except PyKotaStorageError, msg :    
-            self.parent.rollbackTransaction()
-            raise PyKotaStorageError, msg
-        else :    
-            self.parent.commitTransaction()
-            self.parent.flushEntry("PRINTERS", self.Name)
-            if self.parent.usecache :
-                for (k, v) in self.parent.caches["USERPQUOTAS"].items() :
-                    if v.Printer.Name == self.Name :
-                        self.parent.flushEntry("USERPQUOTAS", "%s@%s" % (v.User.Name, v.Printer.Name))
-                for (k, v) in self.parent.caches["GROUPPQUOTAS"].items() :
-                    if v.Printer.Name == self.Name :
-                        self.parent.flushEntry("GROUPPQUOTAS", "%s@%s" % (v.Group.Name, v.Printer.Name))
-            self.isDirty = False            
-            self.Exists = False
+        self.parent.deletePrinter(self)
+        self.parent.flushEntry("PRINTERS", self.Name)
+        if self.parent.usecache :
+            for (k, v) in self.parent.caches["USERPQUOTAS"].items() :
+                if v.Printer.Name == self.Name :
+                    self.parent.flushEntry("USERPQUOTAS", "%s@%s" % (v.User.Name, v.Printer.Name))
+            for (k, v) in self.parent.caches["GROUPPQUOTAS"].items() :
+                if v.Printer.Name == self.Name :
+                    self.parent.flushEntry("GROUPPQUOTAS", "%s@%s" % (v.Group.Name, v.Printer.Name))
+        self.Exists = False
+        self.isDirty = False            
         
 class StorageUserPQuota(StorageObject) :
@@ -344,15 +325,9 @@
     def delete(self) :    
         """Deletes an user print quota entry from the database."""
-        self.parent.beginTransaction()
-        try :
-            self.parent.deleteUserPQuota(self)
-        except PyKotaStorageError, msg :    
-            self.parent.rollbackTransaction()
-            raise PyKotaStorageError, msg
-        else :    
-            self.parent.commitTransaction()
-            if self.parent.usecache :
-                self.parent.flushEntry("USERPQUOTAS", "%s@%s" % (self.User.Name, self.Printer.Name))
-            self.Exists = 0
+        self.parent.deleteUserPQuota(self)
+        if self.parent.usecache :
+            self.parent.flushEntry("USERPQUOTAS", "%s@%s" % (self.User.Name, self.Printer.Name))
+        self.Exists = False
+        self.isDirty = False
         
 class StorageGroupPQuota(StorageObject) :
@@ -379,15 +354,8 @@
     def reset(self) :    
         """Resets page counter to 0."""
-        self.parent.beginTransaction()
-        try :
-            for user in self.parent.getGroupMembers(self.Group) :
-                uq = self.parent.getUserPQuota(user, self.Printer)
-                uq.reset()
-                uq.save()
-        except PyKotaStorageError, msg :    
-            self.parent.rollbackTransaction()
-            raise PyKotaStorageError, msg
-        else :    
-            self.parent.commitTransaction()
+        for user in self.parent.getGroupMembers(self.Group) :
+            uq = self.parent.getUserPQuota(user, self.Printer)
+            uq.reset()
+            uq.save()
         self.PageCounter = 0
         self.DateLimit = None
@@ -396,15 +364,8 @@
     def hardreset(self) :    
         """Resets actual and life time page counters to 0."""
-        self.parent.beginTransaction()
-        try :
-            for user in self.parent.getGroupMembers(self.Group) :
-                uq = self.parent.getUserPQuota(user, self.Printer)
-                uq.hardreset()
-                uq.save()
-        except PyKotaStorageError, msg :    
-            self.parent.rollbackTransaction()
-            raise PyKotaStorageError, msg
-        else :    
-            self.parent.commitTransaction()
+        for user in self.parent.getGroupMembers(self.Group) :
+            uq = self.parent.getUserPQuota(user, self.Printer)
+            uq.hardreset()
+            uq.save()
         self.PageCounter = self.LifePageCounter = 0
         self.DateLimit = None
@@ -431,15 +392,9 @@
     def delete(self) :    
         """Deletes a group print quota entry from the database."""
-        self.parent.beginTransaction()
-        try :
-            self.parent.deleteGroupPQuota(self)
-        except PyKotaStorageError, msg :    
-            self.parent.rollbackTransaction()
-            raise PyKotaStorageError, msg
-        else :    
-            self.parent.commitTransaction()
-            if self.parent.usecache :
-                self.parent.flushEntry("GROUPPQUOTAS", "%s@%s" % (self.Group.Name, self.Printer.Name))
-            self.Exists = 0
+        self.parent.deleteGroupPQuota(self)
+        if self.parent.usecache :
+            self.parent.flushEntry("GROUPPQUOTAS", "%s@%s" % (self.Group.Name, self.Printer.Name))
+        self.Exists = False
+        self.isDirty = False
         
 class StorageJob(StorageObject) :
