Hi Pierre,

thanks for replying. I remember that I already stumbled upon the blog
page you mention before I posted my question on this list. I admit
that I didn't read it in depth back then. But I took as a good sign
that you wrote in your final line: "Everything works fine and web2py
runs with Jython. :-)"

I did not read it in detail because your description was not quite
matching with my prospective setup. My Linux distribution won't be
quite the same, and as a restricted user I will certainly be in no
position to install packages. In addition to that I didn't understand
some details of your instructions. Why would it be necessary to build
the SQLite native library? It is true that Jython comes *without* a
sqlite3 module ("import sqlite3" fails on Jython). But that's why the
zxJDBC driver has to be put into the classpath. When it is loaded it
will be announced in the web2py startup with the line "Database
drivers available: pymysql, zxJDBC". IMHO that should suffice.

I am certainly missing parts of the whole picture here, but if
building a SQLite native library is a required step for setting up
web2py on Jython, it certainly should be put into the "Official web2py
Book". So far there is no mention of such a requirement now.

On the contrary, I believe the native sqlite library is not needed.
Most convincing for me: When I start a clean source code install of
web2py R-1.85.2 unter Jython/Linux and access the welcome app via
browser, then a sqlite database automagically appears in the
filesystemin a newly created folder 'databases'. Via admin app the
database can be edited. For example I added a new user and then
verified that the new entry was written to the database file.

As an addititional note, when I verified this behaviour with R-1.85.2,
I noticed a bug (attention Massimo). Unter Jython the name of the
database, as declared in models/db.py, gets 'shortened'. With the
standard declaration "db = DAL('sqlite://storage.sqlite')" the name of
the file in folder 'databases' is  'ge.sqlite'. If I change the name
in the declaration to 'richardstorage.sqlite' the real database file
is named 'rdstorage.sqlite'. Somehow the first five chars get dropped
unter Jython 2.5.2, verified unter Windows XP and Linux (Ubuntu
derivative). No such error running this version of web2py under Python
2.6. I can't tell if this error still exist in hg tip since other
errors stop me before that point :-(

Regards,
Richard

Reply via email to