Foros de discusión

How can I manage two different databases for different entities in lr 6.1

Kiran Kumar Boyini, modificado hace 11 años.

How can I manage two different databases for different entities in lr 6.1

Expert Mensajes: 287 Fecha de incorporación: 2/06/11 Mensajes recientes
Hi All,

I have the following requirement.I want to read the data from entity belongs to database1 and write those data into another entity
belongs to another database.

How can I achieve this requirement in liferay .

I tried using service builder,but I am getting exception.I posted this issue in previous post

Please help me.

Regards,

Kiran.
thumbnail
David H Nebinger, modificado hace 11 años.

RE: How can I manage two different databases for different entities in lr 6

Liferay Legend Mensajes: 14917 Fecha de incorporación: 2/09/06 Mensajes recientes
Using multiple databases in SB works just fine. I do it all the time.

Your exception is what it is, the secondary table does not exist. I guess you either disabled the auto.upgrade flag (so SB would not create the table) or you're using credentials that cannot create tables.
Kiran Kumar Boyini, modificado hace 11 años.

RE: How can I manage two different databases for different entities in lr 6

Expert Mensajes: 287 Fecha de incorporación: 2/06/11 Mensajes recientes
Thanks for reply David,

Now it is working fine .But here the problem every time I am getting error related to an entity which is not belongs to database.

Here I am using two databases(lportal,dbfeb4), entities(employee_EmployeeLportal,employee_employee) respectively.

But when I am trying to get the list of employee.
java.util.List  <employee>employeeListObj=null;	
employeeListObj=EmployeeLocalServiceUtil.getEmployees(0, EmployeeLocalServiceUtil.getEmployeesCount());</employee>

It is showing the error below in log file as follows:
ERROR [JDBCExceptionReporter:75] Table 'lportal.employee_employee' doesn't exist
com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.dao.orm.ORMException: org.hibernate.exception.SQLGrammarException: could not execute query
at com.liferay.portal.service.persistence.impl.BasePersistenceImpl.processException(BasePersistenceImpl.java:193)


As you said I tried with build.auto.upgrade=true/false in service properties file of my portlet.

Is that any configuration require to avoid this error.

Regards,
Kiran.