掲示板

Hibernate Libs Compartilhadas

thumbnail
8年前 に Victor Menegusso によって更新されました。

Hibernate Libs Compartilhadas

Junior Member 投稿: 31 参加年月日: 11/03/03 最新の投稿
Olá pessoal, tudo bem? eu estou com vários portlets que utilizam o hibernate, e ate então as lib's do hibernate estão dentro de cada portlet. Todos os portlets funcionam muito bem. O problema é o tamanho dos portlets mais o que eles iram ocupar no PermGen do servidor (Glassfish 3.1.2.2 (build 5) )

Quando coloco a hibernate na pasta [domain/lib] do glassfish o portal para de funcionar, aparentemente devido a conflitos e dependencias.
Pensei também em utilizar o "portal.dependency.jars" do "portlet-plugin-package.properties", mas como eu li no link: "https://www.liferay.com/web/pmesotten/blog/-/blogs/classloading-in-liferay" internamente o liferay ira copiar a lib do classpath dele para o classpath do portlet, logo não solucionaria meu problema de uso de memória.


Acabei lendo que eu poderia isolar as libs do liferay usando o "<class-loader delegate="false" />", mas não acredito que seja uma boa solução.


O que vocês me recomendariam?
thumbnail
8年前 に David H Nebinger によって更新されました。

RE: Hibernate Libs Compartilhadas

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
This is the trap of hibernate/jpa, they just don't work in a portlet scenario.

The only possibility you have is to put all of the hibernate portlets into a single portlet plugin. You can then have a single hibernate dependency, but it will take you some work to combine them together.
thumbnail
8年前 に Victor Menegusso によって更新されました。

RE: Hibernate Libs Compartilhadas

Junior Member 投稿: 31 参加年月日: 11/03/03 最新の投稿
David H Nebinger:
This is the trap of hibernate/jpa, they just don't work in a portlet scenario.

The only possibility you have is to put all of the hibernate portlets into a single portlet plugin. You can then have a single hibernate dependency, but it will take you some work to combine them together.




thank David H Nebinger.
thumbnail
8年前 に Peter Mesotten によって更新されました。

RE: Hibernate Libs Compartilhadas

Junior Member 投稿: 45 参加年月日: 09/02/04 最新の投稿
Hi Victor,

I saw this thread because my bog post about classloading was mentioned.

In Liferay 6, there is no way to give your portlets a smaller footprint, certainly not for libraries that are also used by Liferay core and thus that cannot be in the global lib path of Tomcat.

Liferay 7 will have more possibilities, as you will be able to abstract the Hibernate libraries away in a separate OSGi module that can then be shared by all the portlet modules that use the Hibernate stack. So you'll have much more reuse and overall a much smaller memory footprint on the server.

Best regards,
Peter
thumbnail
8年前 に David H Nebinger によって更新されました。

RE: Hibernate Libs Compartilhadas

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
Peter Mesotten:
Liferay 7 will have more possibilities, as you will be able to abstract the Hibernate libraries away in a separate OSGi module that can then be shared by all the portlet modules that use the Hibernate stack. So you'll have much more reuse and overall a much smaller memory footprint on the server.


It's still not clear, however, if it will be a good idea to ditch SB in lieu of hibernate/jpa. Even in the OSGi container, the new SB builds separate modules to support the sharing of a single implementation across multiple consumers using a service module, a separation that you either may not get or may be forced to implement on your own.
thumbnail
8年前 に Victor Menegusso によって更新されました。

RE: Hibernate Libs Compartilhadas

Junior Member 投稿: 31 参加年月日: 11/03/03 最新の投稿
Peter Mesotten:
Hi Victor,

I saw this thread because my bog post about classloading was mentioned.

In Liferay 6, there is no way to give your portlets a smaller footprint, certainly not for libraries that are also used by Liferay core and thus that cannot be in the global lib path of Tomcat.

Liferay 7 will have more possibilities, as you will be able to abstract the Hibernate libraries away in a separate OSGi module that can then be shared by all the portlet modules that use the Hibernate stack. So you'll have much more reuse and overall a much smaller memory footprint on the server.

Best regards,
Peter


Thank Peter Mesotten