Thanks. The flush fixed the problem but I'm having another problem. The
values on the frontpage doesn't update every time, it reads from the cache
instead. What can I do to stop it from reading from the cache?
Dave Johnson-8 wrote:
>
> are you doing a flush() after calling saveLastLogin()?
>
> - Dave
>
>
>
> On 9/25/07, Dudee <[EMAIL PROTECTED]> wrote:
>>
>> I have created a variable called lastLogin that holds a timestamp of the
>> last
>> login to a blog. The problem is that this variable does not get updated
>> when
>> a user login. But when I add,delete or edit an entry the lastModified
>> variable is updated and then also is my variable lastLogin updated so
>> they
>> always hold the same value. I'm using Roller4.0rc2 and here's what I have
>> done:
>>
>> I have created a column (lastLogin) in the website table and I have
>> managed
>> to show these values on the frontpage. (I have added it to the site
>> model).
>>
>> Now I want to update these values when a user login. So I have added som
>> code to the getAuthenticatedUser method in RollerSession.java where I get
>> the users blog (each user can only have one blog) and call a method in
>> WeblogManager that should save this. This method looks like this :
>>
>> public void saveLastLogin(Weblog weblog) throws WebloggerException {
>> log.info("SAVE LAST LOGIN FOR BLOG: "+weblog.getHandle() +"
>> ----Date:"+new
>> java.util.Date());
>> weblog.setLastLogin(new java.util.Date());
>> this.strategy.store(weblog);
>> }
>>
>> I can see in the log that text above is printed out (3 times for some
>> reason!, but with the correct handle and date). I have also added the
>> lastLogin variable to the pojo files.
>>
>> Does anyone know what the problem is?
>> --
>> View this message in context:
>> http://www.nabble.com/Problem-updating-last-login-variable-tf4515952s12275.html#a12880790
>> Sent from the Roller - Dev mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/Problem-updating-last-login-variable-tf4515952s12275.html#a12894995
Sent from the Roller - Dev mailing list archive at Nabble.com.