[Zope-DB] Re: Zope/Plone, interbase, and blob fields

Ashley ashleylloyd at hotmail.com
Wed Sep 7 08:38:07 EDT 2005


Sorry to nag you all again, but I've not managed to resolve this issue.

Basically, I can update a blob field using the Python instance that Python
relies on, but can't use the same syntax to update from an external method
called by Plone.

The syntax that works from the python instance is:
cur.execute("update table_1 set blob_field_1 = ? where other_field_1 = ?",
('blob string value', 'other field value'))

When trying to execute this from an external method, Plone just freezes - no
errors, it just freezes.

The external method is defined as follows:

def updateEntityNotes(self,notes,entKey):
  try:
    dbCon = gvib.connect(theDB, userName, userPass)
    cur=dbCon.cursor()
    cur.execute("UPDATE ENTITY SET EN_NOTES=? WHERE
EN_KEY=?",(notes,int(entKey)))
    dbCon.commit()
    return 'ok'
  except:
    return '<b>Error:</bSorry, your request could not be processed
correctly.<br'+str(traceback.format_exception(sys.exc_type, sys.exc_value,
sys.exc_traceback))

And it is called with a dtml-let call (so the result can be used):
         <dtml-let err="updateEntityNotes(theNotes,theKey)">
(theNotes and theKey have already been subject to calls to be str() and
int() respectively).
I just tested the interface to this from Plone, removing any database access
at all, and just returning a random statement, and it works fine. So Plone
is accessing the external method, there are no imported functions used that
aren't used in other external methods, so it just seems to be executing the
cur.execute() statement. Without the dbCon.commit(), Plone still crashes.

Can anyone tell me why the actual python instance that came with Plone can
do this fine, but Plone itself can't?

Thanks once again to everyone that has helped thus far, but it has been some
time since I received a post, and I've not managed to get this to work.

Cheers

Ashley





More information about the Zope-DB mailing list