2008-11-21_11:49:48-0500 Anil Gangolli <[EMAIL PROTECTED]>:
> I am not seeing any flush() on the persistence strategy in this code 
> path at all, which (assuming READ_COMMITTED transaction isolation) 
> suggests that there may also not be proper exclusion across multiple 
> threads/hosts.   A flush() would be needed on registering the lease as 
> well as releasing the lease.   I think in this case the manager 
> (ThreadManager) actually should be doing this.  Allan, if you're around 
> can you verify ?

I've been playing around with this a bit, and seem to have things mostly
working.

I updated org/apache/roller/weblogger/pojos/TaskLock.orm.xml and
modified the UPDATE TaskLock query from

(formatted for readability)

UPDATE TaskLock t
SET t.clientId=?1,
    t.timeAquired = CURRENT_TIMESTAMP,
    t.timeLeased= ?2,
    t.lastRun= ?3
WHERE t.name=?4 AND
      t.timeAquired=?5 AND
      ?6 &lt; CURRENT_TIMESTAMP

to

UPDATE TaskLock t
SET t.clientId=?1,
    t.timeAquired = CURRENT_TIMESTAMP,
    t.timeLeased= ?2,
    t.lastRun= ?3
WHERE t.name=?4</query>

That alone seems to do the trick.

I also tried adding flush() statements to
org/apache/roller/weblogger/business/jpa/JPAThreadManagerImpl.java to
match the Hibernate code, but didn't notice any affect.  Should there be
flush() statements here to match HibernateThreadManagerImpl.java?

I also noticed that the sitewide cache settings come into play.  I set
cache.sitewide.enabled=false for testing.  The planet cache didn't seem
to affect my configured task updates.

With the change to TaskLock.orm.xml decribed above, with the sitewide
cache turned off, and the following configuration settings, my front
page entries are now updating every two minutes.

# Refresh entries for planet feeds
tasks.RefreshRollerPlanetTask.class=org.apache.roller.weblogger.planet.tasks.RefreshRollerPlanetTask
tasks.RefreshRollerPlanetTask.startTime=immediate
tasks.RefreshRollerPlanetTask.interval=2
tasks.RefreshRollerPlanetTask.leaseTime=10

# Sync Roller weblogs with planet
tasks.SyncWebsitesTask.class=org.apache.roller.weblogger.planet.tasks.SyncWebsitesTask
tasks.SyncWebsitesTask.startTime=immediate
tasks.SyncWebsitesTask.interval=2
tasks.SyncWebsitesTask.leaseTime=10

Does this all look copacetic?

My biggest remaining question is what kind of performance hit would I
take if I disabled the sitewide cache?  I'm proxying (ajp) behind
apache, so Apache will do it's own caching as well.

I suppose the best way to answer that question empirically would be to
do some testing.  I've been wanting to bone up on JMeter for a while
now, maybe this will get me motivated.

-- 
Ron Peterson
Network & Systems Manager
Mount Holyoke College
http://www.mtholyoke.edu/~rpeterso
-
I wish my computer would do what I want it to do - not what I tell it to do.

Reply via email to