Forums de discussion

removing ServiceComponent.buildNamespace before deploying a portlet

thumbnail
OU User, modifié il y a 14 années.

removing ServiceComponent.buildNamespace before deploying a portlet

New Member Publications: 22 Date d'inscription: 04/12/08 Publications récentes
We have several developers working (through CVS) on a portlet project that uses Liferay services. These projects have a build.number in service.properties which is raised each time the project is build.

Also, we have several Liferay servers on which this portlet project is deployed. The servers have their own database, with ServiceComponent.buildNamespace rows containing the build number on the database side.

To avoid the complexity of maintaining this, we tried removing all ServiceComponent.buildNamespace rows that start with our portlet prefix (delete from test.ServiceComponent where buildNamespace = 'ourBuildNamespace'). In other words, when the portlet is deployed, Liferay will allways do an update on the database stucture. This seems to be a non-destructive operation, rows that are in the database will not be removed, even when columns of the table are removed. We tested this on Liferay 5.2.3 (our portlets don't build in a Liferay 6.0 plugins environment yet)

The question is, is this way of working safe, or will we run the risk of losing data later?

TIA for any hints, answers!
thumbnail
Amos Fong, modifié il y a 14 années.

RE: removing ServiceComponent.buildNamespace before deploying a portlet

Liferay Legend Publications: 2047 Date d'inscription: 07/10/08 Publications récentes
Hello,

You should be fine. If no service component is detected, it just tries to run the create table statements, which should only throw warnings at worst if the table already exists.

Take a look at ServiceComponentLocalServiceImpl.java to see exactly how it works.