Using the latest (xotcl 0.42; xowiki 0.35), mount a new xowiki instance. Navigate to the index page, and you'll see "This is the default start page of XoWiki...etc etc" along with three portlets (Recently Changed, Last Visited, Most Popular).
Note the xowiki's root object id aka content_folder (11375 in my case -- its Page Title is ::1375 and is the only page you see now other than "index"). Find the package_id for this xowiki instance (11367 in my case).
Now open a Shell (using DS) and enter the following:
set package_id 11367 set xowiki_folder [::xowiki::Page require_folder -package_id $package_id -name "xowiki"] set o [::xowiki::Object instantiate -item_id $xowiki_folder] $o info class
The Shell will output "::xowiki::Object" as you expect. Why would I want code that does nothing more than that? Well, I don't really; what I ultimately want to do is to programmatically grab the root object (from the xowiki instance package_id) and then edit the text of that xowiki root object and save it. But in trying to figure out why I can't seem to do that, I've found that I get stuck even at this step of getting the root object and confirming that I've got it.
So here's the weird part. After running that code once in the Shell, go back to the index page of the xowiki instance and refresh the page. Probably each of the portlets will show an error from the adp: "can't read "package_id": no such variable". Now refresh the page again -- once or several times, as many as it takes for the portlets to display correctly again. Sometimes it takes only a single refresh, sometimes more. Keep refreshing; every few times the index page will show errors and then it won't -- without any other actions besides refreshing the page.
Now go to the Admin page where you'll see a list of the objects in the xowiki instance -- only 2 for now: an ::xowiki::Page and our ::xowiki::Object. Click on the root Object instance and you'll see a server error because package_id can't be read. Backup in the browser and click the instance again. Now there will be no server error and you'll see the "Index of XoWiki Objects" page with our root object in the list. Now backup in the browser again and click the instance again; the server error will return. Repeat as often as you like; every other trip to the page will return a server error.
Clearly something is going on behind the scenes with this object -- but what? Somehow it periodically forgets and then remembers its package_id (and maybe other things?). I'm guessing this has to do with the ns_cache xotcl_object_cache, since various instprocs flush it when saving objects. But the code I ran in the Shell doesn't save any object; it just retrieves some info.
Any ideas what's going on? Gustaf, can you explain a bit about how we use the object cache, and when we need to flush it, etc? Or is this due to something else? Thanks in advance for any explanations that can help us know how to understand and use xotcl!