You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by "Sie, Yang" <ya...@fmr.com> on 2007/10/30 13:51:24 UTC
Preload OJB Persistent Layer at App Server Startup
Hello All:
Currently, after we shut down and bring up the application server, any
user's first time accessing portal experienced a delay. My understanding
is that the persistent layer is building up for that user's profile
(query is executed and db is called, etc.). I am wondering if there is a
way to load every user's data into persistent layer after app server is
started up each time. User's experience is therefore improved.
Thank you.
---Yang
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org
Re: Preload OJB Persistent Layer at App Server Startup
Posted by David Sean Taylor <da...@bluesunrise.com>.
On Oct 30, 2007, at 5:51 AM, Sie, Yang wrote:
> Hello All:
>
> Currently, after we shut down and bring up the application server, any
> user's first time accessing portal experienced a delay. My
> understanding
> is that the persistent layer is building up for that user's profile
> (query is executed and db is called, etc.). I am wondering if there
> is a
> way to load every user's data into persistent layer after app
> server is
> started up each time. User's experience is therefore improved.
>
You can load preferences with either the Prefs Provider interface or
the Java Preferences API
What looks difficult is loading all preferences for a user, since
they are normally not accessed across that axis
Usually, preferences are loaded for a page, so the indexed path is:
/portlet_entity/${entity_id}/${username}/preferences/
So you would need to the know which entities you want to preload
If each user has a known home page or pages, you could traverse each
users home page, and then load from there:
# this is just a rough algorithm
users = userManager.getAllUsers()
for each user in users
page = pageManager.getPage("/_users/" + user.name + "/home.psml")
for each entity in page-portlet-fragments
# preload
prefsnode = Preferences.userRoot().node("/
portlet_entity/${entity_id}/${username}/preferences/ ");
# not sure, you may need to iterate children to
fully load...
end
end
Where should this code be executed? Well, at startup
You could write a new Spring service to do so
If you want a more formal approach, I suppose we can add a post
container init cycle hook into the Jetspeed engine
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org