[Zope-DB] LOB Writes not "sticking"

John Ziniti jziniti@speakeasy.org
Wed, 19 Mar 2003 15:56:41 -0500


I am trying to write to a CLOB object but the writes do not
appear to be sticking to the object:

<code>
    cnx.execute('SELECT x.xml_doc.getClobVal() FROM xml_transport_docs x 
WHERE id=%s FOR UPDATE' % (id))
    rst = cnx.fetchone()
    clob = rst[0]
    print 'Length: ', clob.length()
    clob.write('crap-diddly-app-app-app')
    print 'Length: ', clob.length()
   
    cnx.execute('SELECT x.xml_doc.getClobVal() FROM xml_transport_docs x 
WHERE id=%s' % (id))
    rst = cnx.fetchone()
    clob = rst[0]
    print 'Length: ', clob.length()
</code>

I print the length() of the clob three times.  Output is:

Length: 11
Length: 23
Length: 11

And the output is back to what it was before.  Any suggestions on
what might be going wrong?  You'll notice that I have to getClobVal()
on the row in my SQL statement.  That's because this row is actually
an XMLTYPE row.  Could that be causing problems?

Thanks in advance,

John Ziniti