Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Kravchenko Dmitry
When Service Builder's tables are created in database?
November 18, 2011 1:53 AM
Answer

Kravchenko Dmitry

Rank: Regular Member

Posts: 139

Join Date: October 4, 2010

Recent Posts

I have deleted a table of my service from (MySQL) database. And now have portlet error messages that table is not exist. How to initiate recreation? I had never created service tables manually. They were created automatically but now stopped.
Yamini T
RE: When Service Builder's tables are created in database?
November 18, 2011 2:33 AM
Answer

Yamini T

Rank: Junior Member

Posts: 32

Join Date: July 26, 2011

Recent Posts

Hi,

just follow ant commands build-db,clean,compile,deploy .
May be it works.

Regards
Jhansi P.
Aritz Galdos
RE: When Service Builder's tables are created in database?
November 18, 2011 2:42 AM
Answer

Aritz Galdos

Rank: Expert

Posts: 405

Join Date: May 15, 2007

Recent Posts

Hi Kravchenko

In case Jhansi's method doesn´t work you can do as follows:

Liferay will not (re)create tables of your portlet as far as Liferay thinks they are already created. And why does Liferay think they are created? Just have a look to "servicecomponent" table. There will be some rows that refer in the buildNamespace to yours. This is why Liferay still thinks you component is already created.

Just delete rows refering to your component. The restart portal. And redeploy.

good luck!
Tejas Kanani
RE: When Service Builder's tables are created in database?
November 18, 2011 3:16 AM
Answer

Tejas Kanani

Rank: Liferay Master

Posts: 655

Join Date: January 6, 2009

Recent Posts

Try by deleting an entry from servicecomponent table. And redeploy your portlet.

delete FROM servicecomponent where buildNamespace="<your table namespace>"


Regards,
Tejas Kanani
Amos Fong
RE: When Service Builder's tables are created in database?
November 18, 2011 2:45 AM
Answer

Amos Fong

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1913

Join Date: October 7, 2008

Recent Posts

I would suggest to create it manually (you can find the non-DB specific SQL from tables.sql) because it's the least intrusive way.

But if you want Liferay to do it automatically, what you can do is run this SQL:

delete from ServiceComponent where buildnamespace = '[your portlet table's namespace]';

Then on redeploy it will act as if your portlet has never been deployed before and try to create the tables. If done this way, I would backup your DB first.
Hitoshi Ozawa
RE: When Service Builder's tables are created in database?
November 18, 2011 3:45 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

I think it's better to delete a row from the ServiceComponent table because generated SQL command doesn't work without modification such as datatype and data length.
Kravchenko Dmitry
RE: When Service Builder's tables are created in database?
November 18, 2011 7:40 AM
Answer

Kravchenko Dmitry

Rank: Regular Member

Posts: 139

Join Date: October 4, 2010

Recent Posts

Thanks for telling about service component table!!! This is what I was looking for!
Nagendra Kumar Busam
RE: When Service Builder's tables are created in database?
November 18, 2011 9:14 AM
Answer

Nagendra Kumar Busam

Rank: Liferay Master

Posts: 653

Join Date: July 7, 2009

Recent Posts

Even i prefer doing it by delete a row from the ServiceComponent table

I have question regarding service builder (deleting a column from table/entity @ later stages not reflecting in DB )

Here is my use case

- suppose i have a created a table through service builder with suppose three columns like col1,col2,col3
- Later due to dependency on some external system table structure has been changed like deleted col3

I have not see this change will be reflecting in DB automatically. BTW i am using 5.2 EE SP3 right now (I have not checked this with latest version though)

Regards,
- Nagendra Kumar
Charles Devin Riley
RE: When Service Builder's tables are created in database?
April 10, 2015 8:39 AM
Answer

Charles Devin Riley

Rank: New Member

Posts: 5

Join Date: March 25, 2015

Recent Posts

hey thanks! this really helped me.