Re: TorqueUser synchronization problem

Weffen Cheung <[email protected]> Thu, 12 Jan 2012 03:04:51 +0800
Newsgroups gmane.comp.jakarta.turbine.user
Message-ID <[email protected]>
Hello Thomas,

Thanks for your reply.

Sometimes I update a user record not only after the user login. For example, I want to update userB's record when userA login. For this case, we cannot use data.getUser().save(), is it right?

Thanks!

Weffen


在 2012-1-12,上午2:58, Thomas Vandahl 写道:

> Hi,
> 
> On 11.01.12 11:19, Weffen Cheung wrote:
>> I have used turbine as my products for a few years, but i am not familiar with TorqueUser. When I modify some user data directly with jdbc, I found that the data in data.getUser() is still the old data, it cannot synchronize automatically.
>> 
>> For example, I update user's email by this way:
>> 
>> Connection conn = Torque.getConnection();
>> conn.createStatement().executeUpdate("UPDATE turbine_user SET email='[email protected] WHERE huiyuan_id='1234'");
>> 
>> But I found that the user(1234)'s email  did not change until he logins again. 
>> I have to reload the TorqueUser in SessionValidator all the time. I think it is not a good solution.  Is it there any good solution for that?
> 
> You can use data.getUser().setEmail("[email protected]") followed by a
> data.getUser().save(). Is there any special reason for the separate
> UPDATE statement?
> 
> Bye, Thomas.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 


--
Weffen Cheung
E: [email protected]
M: 13802222618