Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
martin cizek
Multi instance liferay
October 29, 2008 8:07 AM
Answer

martin cizek

Rank: New Member

Posts: 4

Join Date: February 29, 2008

Recent Posts

Hi,

I installed oracle database schema and started two liferay instances. Then I develop custom authentication proccess, during this proccess I create new user account and save it into database using method UserLocalServiceUtil.addUser. In case of running only one liferay instance everything works fine, but in case of running two instances the problem occures.

The problem: userId generation which is handled by liferay.

Every instance has different userId starting value (it differs by 100 in default configuration), after inseting a few users userId conflict appears - insert is denied by constaint - unique userId.

Is there any easy way to use database sequence for userId generation ? Or is there any different way to avoid mentioned problem ?

I found that is not problem only for userId, but probably for all unique ids generated by lifery (i know it for sure only for userId and pageId).

Thanks for you help

mc
Jerry Niu
RE: Multi instance liferay
October 29, 2008 10:05 AM
Answer

Jerry Niu

LIFERAY STAFF

Rank: Expert

Posts: 451

Join Date: June 21, 2006

Recent Posts

martin cizek:
two liferay instances


Interesting. Liferay normally recognizes an instance separated via our data. For 2 webapps hitting the same Liferay db, it would present problems.

Well, since you're not in our typical mutli instance setup. I might look at overriding our spring.
Lari Tuominen
RE: Multi instance liferay
October 29, 2008 12:41 PM
Answer

Lari Tuominen

Rank: Expert

Posts: 283

Join Date: November 7, 2007

Recent Posts

I found that is not problem only for userId, but probably for all unique ids generated by lifery (i know it for sure only for userId and pageId).


Yes I can confirm that. If I recall right, liferay uses counter implementation to give unique ids for basically everything that needs one - meaning users, contacts, organizations, layouts, groups......... (to everything). So basically overriding that counter implementation could be one solution.
Of course this may not be the only problem that you will face if two instances are sharing the common database.

- Lari
MICHAIL MOUDATSOS
RE: Multi instance liferay
November 15, 2011 12:36 AM
Answer

MICHAIL MOUDATSOS

Rank: Regular Member

Posts: 110

Join Date: October 4, 2011

Recent Posts

Hello there,

Is this behavior fixed in Liferay 6.0.6? I'm really worried about this since we have put up an installation at a customer, which uses two different Liferay-appserver installations in two different machines which both point to the same db. The first machine has the ip which is mapped to the default site (in cotrol panel virtual host entry) and the second machine has the ip which assigned to a Liferay instance generated from the admin control panel of the default instance.

The need for doing this is that we wanted to expose only the second machine to internet users and have some management portlets in the first. A side effect is that if you access the ip of the created instance with an ip - name mapping (via htaccess) that is not valid the default instance is exposed. One work around was to deploy different wars at each machine this way default instance is exposed, yet without functionality. (still omni admin is exposed for hacking)

so apart from my worries whether I could disable this redirection somehow, now I read that I may have conflicting User_ primary keys (userId-s), in the future!! I would really like to hear otherwise, or at least confirm this bad phenomenon, because its rather critical!

thank you in advance!
Geeta Raghu Vamsi Kotipalli
RE: Multi instance liferay
November 15, 2011 3:01 AM
Answer

Geeta Raghu Vamsi Kotipalli

Rank: Junior Member

Posts: 58

Join Date: November 9, 2011

Recent Posts

Hi,

This Multiple Instance Hitting to One Single DB works like charm because i have done a setup at our office on this which i gave access for multiple liferay instances to access one particular DB and coming to one Tomcat running two different database this can also be accomplished by giving multiple database parameters in the ROOT.xml file.

Thanks
K.G.R Vamsi