Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Kiran Kumar Boyini
How can I manage two different databases for different entities in lr 6.1
February 19, 2013 2:24 AM
Answer

Kiran Kumar Boyini

Rank: Expert

Posts: 274

Join Date: June 2, 2011

Recent Posts

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.
David H Nebinger
RE: How can I manage two different databases for different entities in lr 6
February 19, 2013 6:02 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 6476

Join Date: September 1, 2006

Recent Posts

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
RE: How can I manage two different databases for different entities in lr 6
February 19, 2013 10:20 PM
Answer

Kiran Kumar Boyini

Rank: Expert

Posts: 274

Join Date: June 2, 2011

Recent Posts

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.
1java.util.List  <Employee>employeeListObj=null;   
2employeeListObj=EmployeeLocalServiceUtil.getEmployees(0, EmployeeLocalServiceUtil.getEmployeesCount());

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.