Index: pykota/trunk/pykota/storages/sql.py
===================================================================
--- pykota/trunk/pykota/storages/sql.py (revision 2706)
+++ pykota/trunk/pykota/storages/sql.py (revision 2707)
@@ -572,6 +572,8 @@
     def saveUser(self, user) :        
         """Saves the user to the database in a single operation."""
-        self.doModify("UPDATE users SET limitby=%s, email=%s, overcharge=%s, description=%s WHERE id=%s" \
+        self.doModify("UPDATE users SET limitby=%s, balance=%s, lifetimepaid=%s, email=%s, overcharge=%s, description=%s WHERE id=%s" \
                                % (self.doQuote(user.LimitBy or 'quota'), \
+                                  self.doQuote(user.AccountBalance or 0.0), \
+                                  self.doQuote(user.LifeTimePaid or 0.0), \
                                   self.doQuote(user.Email), \
                                   self.doQuote(user.OverCharge), \
@@ -618,11 +620,4 @@
         self.doModify("UPDATE users SET balance=balance - %s WHERE id=%s" % (self.doQuote(amount), self.doQuote(user.ident)))
        
-    def writeUserAccountBalance(self, user, newbalance, newlifetimepaid=None) :    
-        """Sets the new account balance and eventually new lifetime paid."""
-        if newlifetimepaid is not None :
-            self.doModify("UPDATE users SET balance=%s, lifetimepaid=%s WHERE id=%s" % (self.doQuote(newbalance), self.doQuote(newlifetimepaid), self.doQuote(user.ident)))
-        else :    
-            self.doModify("UPDATE users SET balance=%s WHERE id=%s" % (self.doQuote(newbalance), self.doQuote(user.ident)))
-            
     def writeNewPayment(self, user, amount, comment="") :
         """Adds a new payment to the payments history."""
Index: pykota/trunk/pykota/storages/ldapstorage.py
===================================================================
--- pykota/trunk/pykota/storages/ldapstorage.py (revision 2706)
+++ pykota/trunk/pykota/storages/ldapstorage.py (revision 2707)
@@ -1048,4 +1048,9 @@
         self.doModify(user.ident, newfields)
         
+        newfields = { "pykotaBalance" : str(user.AccountBalance or 0.0),
+                      "pykotaLifeTimePaid" : str(user.LifeTimePaid or 0.0), 
+                    }
+        self.doModify(user.idbalance, newfields)
+        
     def saveGroup(self, group) :
         """Saves the group to the database in a single operation."""
@@ -1096,13 +1101,4 @@
         return self.doModify(user.idbalance, fields, flushcache=1)         
        
-    def writeUserAccountBalance(self, user, newbalance, newlifetimepaid=None) :    
-        """Sets the new account balance and eventually new lifetime paid."""
-        fields = {
-                   "pykotaBalance" : str(newbalance),
-                 }
-        if newlifetimepaid is not None :
-            fields.update({ "pykotaLifeTimePaid" : str(newlifetimepaid) })
-        return self.doModify(user.idbalance, fields)         
-            
     def writeNewPayment(self, user, amount, comment="") :
         """Adds a new payment to the payments history."""
Index: pykota/trunk/pykota/storage.py
===================================================================
--- pykota/trunk/pykota/storage.py (revision 2706)
+++ pykota/trunk/pykota/storage.py (revision 2707)
@@ -76,15 +76,8 @@
         """Sets the user's account balance in case he pays more money."""
         diff = float(lifetimepaid or 0.0) - float(self.LifeTimePaid or 0.0)
-        self.parent.beginTransaction()
-        try :
-            self.parent.writeUserAccountBalance(self, balance, lifetimepaid)
-            self.parent.writeNewPayment(self, diff, comment)
-        except PyKotaStorageError, msg :    
-            self.parent.rollbackTransaction()
-            raise PyKotaStorageError, msg
-        else :    
-            self.parent.commitTransaction()
-            self.AccountBalance = balance
-            self.LifeTimePaid = lifetimepaid
+        self.AccountBalance = balance
+        self.LifeTimePaid = lifetimepaid
+        self.parent.writeNewPayment(self, diff, comment)
+        self.isDirty = True
         
     def setLimitBy(self, limitby) :    
