Fórumok

L6 - Portlet development - hibernate - own pool or use of Liferay's

Sergey Stepanenko, módosítva 13 év-val korábban

L6 - Portlet development - hibernate - own pool or use of Liferay's

Junior Member Bejegyzések: 47 Csatlakozás dátuma: 2010.06.01. Legújabb bejegyzések
Hello,

Trying to understand the whole idea or plugin development (not EXT) I see that it should be isolated from Liferay. But I would like to get an idea from guru's - which way should I go - use (for example) custom portlet's own pool (using hibernate or whatever) or try to use what Liferay offers (servicebuilder)?

Which one is better?
I do understand that my own db connection/pool gives some isolation and all the pros that come with this approach. On the other hand - managing a separate connection pool for custom portlet (or portlets) mya be not worth it?

Thanks in advance!
thumbnail
Shagul Khajamohideen, módosítva 13 év-val korábban

RE: L6 - Portlet development - hibernate - own pool or use of Liferay'

Liferay Master Bejegyzések: 758 Csatlakozás dátuma: 2007.09.27. Legújabb bejegyzések
This is a very good question. You should consider it case by case.

If you are writing portlets that aggregate some of the existing (legacy) applications, you will obviously have a separate datasource for it. More likely you will just use one of the API's exposed by those applications.

If your portlets are more independent of Liferay (portability across vendors is a concern), it will make sense to have a separate database and JNDI datasource available that all your custom portlet applications could use. Every portlet or every portlet application managing the connection pool to the same database is not a good option. If portability is the concern than it goes beyond datasource as your code should not rely much on Liferay specific API's.

If you are extending the Liferay specific functionality or the scenario does not demand use of its own datasource, you can use the portals datasource.

Liferay already uses two datasources. One for the counter and one for the rest of the portal.

Liferay is a portal as well as a portlet development framework. All depends on your requirements whether to use Liferay as a JSR-286 portal or use the plugins SDK also as your development framework.