From: Andreas N. <an...@kl...> - 2003-06-22 12:06:17
|
Hey folks, finally found the time to do some OI 2 / Beta 0 testing. First impression in short: already works great. Testenvironment was RedHat Linux 9, which includes a 5.8.0-ithread perl version. During the installation, I only had the "usual" RH 9 and perl problems comming from the new defaults for languages et. al ( e.g. UTF-8 charsets ), which lead to problems with quite a few perl moduels. Apart from this, I only got an error during make test from the SQLite module, which I chose to ignore. After this I followed the readme / Manual::Intro and setup a testing site with lwp. This all worked by the book ! The only spottable "error" I found in the news package: here the display of dates is not correct in the templates. It shows the class name, so I assume a deref is missing somewhere. Switching on debugging als shows, that OI 2 is whining about a few classes not specifying a "date conversion format". These are classes News, ErrorObject, Page, User and ObjectAction. Next I tested with apache 1.3.26 / mod_perl 1.27 by switching the types in the configs. I was interested, if this would do any harm to the site or change anything in the layout - no - works w/o a problem. Now I switched the DBI type from SQLite to Mysql 4.0.13, reinstalled the SQL etc -> success. Now back to LWP -> no problem. Since this all worked to easy so far ;-), I tried to go for Apache2/mod_perl2 by registering a new factory type for the request/response classes and setting up an Apache2::OpenInteract2 handler class. Basically, it turns out to be a rather small task with the main "problem" being, that the mod_perl2 documentation is not ready yet. BTW: could anyone tell me where $REQUEST_CLASS is set in Request.pm and where the get_current method in Request/Apache.pm comes from ? I fell across s.th. different, though: treads and databases ! Since mod_perl2 works with ithreads ( meaning one perl instance in every thread), which means, a shared nothing aproach is used, I did not see reason for not trying the treaded worker mpm. The problem is, that in perl 5.8.0 you cannot share any object across threads, so also no db connections. This also means, that you cannot use any db object from the initial thread in any other thread. Here I fell with OI2, since the db connections are made quite early, before the initial thread is cloned to handle the request. Probably, you would have the same problem with any other threaded environment, as long as the db connections are setup in advance. Is there a chance to kick the connections and reestablish them in them when the request is handled? At that point, you could do caching of db connections, since you are within a separate thread. Also I tried to read a bit through the OI2 code and find it a lot more understandable than the OI1 code. I especially like the use of Class::Accessor and Class::Factory and the CTX singleton. Looking at the new News package, I found it not too different from the OI1 packages, which is great because it means that porting modules should not hurt too much. The verbose feedback of oi2_manage is also a good idea. In short: first impression is really great - well done Chris ! regards, Andreas |