Forums

Home » Liferay Portal » English » 3. Development »

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
mark s
Question on sql to modify db directly
May 15, 2009 12:22 PM
Answer

mark s

Rank: New Member

Posts: 3

Join Date: May 15, 2009

Recent Posts

Greetings,

I am just getting started with developing for liferay.

I tried running the following sql:

update User_ set active_ = 1 where screenName = 'blah';
commit;

however, liferay continues to see the user as deactivated, even after restart. When I set the active flag back to Yes using the User control panel, I see that the value changes in the db and liferay now sees the user as active. Is there more to activating and deactivating users than just setting this column? I even tried using mysqldump on the database before and after liferay activates the user, and the only change I could see in the entire db is the active flag, and yet when I change it liferay does not recognize it. Can anyone explain how this is possible?

regards,

fojae
Rice Owl
RE: Question on sql to modify db directly
May 16, 2009 3:31 PM
Answer

Rice Owl

Rank: Regular Member

Posts: 177

Join Date: April 23, 2009

Recent Posts

Just a thought, but could it be due to caching on LIfeRay's part? Try restarting liferay after making the change to see if that changes the user activation state or in the control panel, you can clear LR's caches. Try either one of those. I'm thinking, if all LifeRay is doing is changing that flag, that its a caching issue. LifeRay may cache the user information, thus when an outside process updates teh database, the cache is "dirty" within LifeRay.
Victor Zorin
RE: Question on sql to modify db directly
May 17, 2009 1:14 AM
Answer

Victor Zorin

Rank: Liferay Master

Posts: 985

Join Date: April 14, 2008

Recent Posts

You are able to change values directly in user_ table, but If you are in Liferay version 5.2+, after running SQL you will have to re-index user data by doing:
Control Panel->Server Administration->Reindex all search indexes->Execute.

To see the changes, there is no need to restart the server as re-indexing would clear the cache anyway.
Ahmed Hasan
RE: Question on sql to modify db directly
May 17, 2009 11:57 PM
Answer

Ahmed Hasan

Rank: Regular Member

Posts: 115

Join Date: April 13, 2007

Recent Posts

Dear Victor,

Thanks for this great information. Will try and see this in action.

For any help feel free to contact me,

Ahmed Hasan
CTO, TransIT mPower Labs (P) Ltd.
info@mpowerglobal.com
mPower Global Inc.
A Liferay expert company.