ZODB list,

I have a bookstore that uses the ZODB as its storage.  It uses qooxdoo as
the client and CherryPy for the server.  The server has a 'saveBookById'
routine that works 'most' of the time.  However, sometimes the
transaction.commit() does NOT commit the changes and when I restart my
server the changes are lost.  

My save routine writes a message to a log file each time a book is saved and
the log file ALWAYS shows that the book is saved successfully, even when it
is not.  Following is the relevant code.  I am sure the keys (bookNumber and
storeNumber ) are correct for each call.

Please give me some clues and a place to start looking.  Tell me what
information you need to help.  The ZODB is really nice, but it is also very
mysterious.

Thanks,

Tom
      ... record, bookNumber and storeNumber are defined previously. and
db.dbRoot['books'] is an IOBTree
     ...  record is the book record, bookNumber and storeNumber are both
integers.
     ... record is a regular python dictionary
    ... the except clause below is never triggered

        bookBase = db.dbRoot['books'][storeNumber]
        try:
            bookBase[bookNumber] = record 
            db.dbRoot['books'][storeNumber] = bookBase   
            transaction.commit()     
            
            log("saveNewBook " + str(bookNumber) + "\t" + str(record))          
  
            log("ADD NEW BOOK SUCCESSFULL" + str(bookNumber))
            return  json.write( { "status" :  "success" , 'book-id' : bookId
, 'title': title,  'store-number': storeNumber,  'book-number': bookNumber, 
'record': record} )            
        
        except:
            log("ERROR in saveNewBook " + str(bookNumber) + "\t" +
str(record))
            return  json.write( { "status" :  "failure" , 'msg' : "Book
could not be added."} )    

-- 
View this message in context: 
http://www.nabble.com/zodb-does-not-save-transaction-tp17526533p17526533.html
Sent from the Zope - ZODB-Dev mailing list archive at Nabble.com.

_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev

Reply via email to