If I use cache, for example:
def putRecipesInCache():
recipesCache = cache.ram('recipes', lambda: db().select(db.recipes.IMAGE
), time_expire=60*60*24)
return recipesCache
def index():
rows = putRecipesInCache()
image = ''
for row in rows:
if row.IMAGE is None:
image += ''
else:
import codecs
base64_data = codecs.encode(row.IMAGE.read(), 'base64')
base64_text = codecs.decode(base64_data, 'ascii')
image += '<img src="data:image/png;base64, %s"
class="card-img-top" alt="..."/>' % base64_text
return XML()
I get error:
Error snapshot [image: help]
<http://127.0.0.1:8000/admin/default/ticket/Recipes/127.0.0.1.2019-08-17.14-59-19.0443afad-ae9d-4f01-8b4c-f5a8c1af81ce#>
DatabaseError(('Cursor.read_output_blob/isc_open_blob2:\n- SQLCODE: -904\n-
invalid database handle (no active connection)', -904, 335544324))
inspect attributes
Frames
-
*File C:\web2py\gluon\restricted.py in restricted at line 219* код
аргументы переменные
-
*File C:\web2py\applications\Recipes\controllers\default.py in <module>
at line 226* код аргументы переменные
-
*File C:\web2py\gluon\globals.py in <lambda> at line 421* код аргументы
переменные
-
*File C:\web2py\applications\Recipes\controllers\default.py in index at
line 74* код аргументы переменные
-
*File C:\web2py\applications\Recipes\controllers\default.py in
selectRecipes at line 146* код аргументы переменные
-
*File C:\Program Files (x86)\Python37-32\lib\site-packages\fdb\fbcore.py
in read at line 4764* код аргументы переменные
-
*File C:\Program Files (x86)\Python37-32\lib\site-packages\fdb\fbcore.py
in __ensure_open at line 4658* код аргументы переменные
-
*File C:\Program Files (x86)\Python37-32\lib\site-packages\fdb\fbcore.py
in __open at line 4667* код аргументы переменные
Function argument list
(self=<fdb.fbcore.BlobReader object>)
Code listing
4662.
4663.
4664.
4665.
4666.
4667.
4668.
4669.
4670.
4671.
bs([ibase.isc_bpb_version1, ibase.isc_bpb_type, 1,
ibase.isc_bpb_type_stream]))
if db_api_error(self._isc_status):
raise exception_from_status(DatabaseError,
self._isc_status,
"Cursor.read_output_blob/isc_open_blob2:")
# Get BLOB total length and max. size of segment
result = ctypes.cast(ctypes.create_string_buffer(20),
buf_pointer)
api.isc_blob_info(self._isc_status, self._blob_handle, 2,
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/1682f597-1f05-4072-a56e-adb03173d6d0%40googlegroups.com.