Grails: One Database and more than one application

2019-04-11 07:48发布

I am having Grails GORM based application.One web service and one website both are running on different port and sharing common database and tables.
What i have done is created domain class for both application which are having same fields and domain class name.For example Registration table having userName and password fields.One can register through web service and also from website.
My current applications is working fine...but is it a feasible solution..?

Thanks,
Viral

标签: grails gorm
1条回答
相关推荐>>
2楼-- · 2019-04-11 08:35

You could run into race/locking conditions but I've seen this done on many occasions. My only suggestion is that you not maintain separate domain classes. Put common domain classes in a plugin and install said plugin in both applications.

Another common approach I've seen that mimics your approach is deploying a customer facing app separate from the admin/cms. Both talk to the same database, they're just running in different tomcat instances.

查看更多
登录 后发表回答