Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old hibernate #17428

Closed
wezell opened this issue Oct 4, 2019 · 8 comments
Closed

Remove old hibernate #17428

wezell opened this issue Oct 4, 2019 · 8 comments

Comments

@wezell
Copy link
Contributor

@wezell wezell commented Oct 4, 2019

When running dotCMS, we set up our HibernateUtil and then also instantiate the old Liferay HibernateUtil which sets up its own Hibernate session complete with its own transaction lifecycle. We need to remove that and only rely our our HibernateUtil to run and manage sessions.

wezell added a commit that referenced this issue Oct 4, 2019
wezell added a commit that referenced this issue Oct 4, 2019
@jdotcms

This comment has been minimized.

Copy link
Contributor

@jdotcms jdotcms commented Oct 4, 2019

I am wondering if it is not a good time to rename the HibernateUtil to TransactionUtil or so

@wezell wezell added this to the Cody Current milestone Oct 7, 2019
@wezell

This comment has been minimized.

Copy link
Contributor Author

@wezell wezell commented Oct 7, 2019

I am wondering if it is not a good time to rename the HibernateUtil to TransactionUtil or so

Probably, but there is a lot of hibernate specific Code in the HibernateUtil so I don't think a rename would work. We should rather move all the transaction stuff out of it and into a TransactionUtil.

@jdotcms

This comment has been minimized.

Copy link
Contributor

@jdotcms jdotcms commented Oct 7, 2019

we can translate the code to the TransactionUtil and use the HibernateUtil as a wrapper of the TransactionUtil, so no pain!

fabrizzio-dotCMS added a commit that referenced this issue Oct 15, 2019
fabrizzio-dotCMS added a commit that referenced this issue Oct 15, 2019
@jgambarios

This comment has been minimized.

Copy link
Contributor

@jgambarios jgambarios commented Oct 17, 2019

PR: #17486

jgambarios added a commit that referenced this issue Oct 17, 2019
* #17428 working, needs testing [travis postgres]

* #17428 user tests passing

* #17428 more removing hibernate

* #17428 testing build

* #17428 fix travis + synchronized build buildSessionFactory
@wezell

This comment has been minimized.

Copy link
Contributor Author

@wezell wezell commented Oct 17, 2019

Testing the updating of the System > Configuration > Company Image - you get this in the logs:

11:45:06.339  WARN  pool.ProxyLeakTask - Connection leak detection triggered for org.postgresql.jdbc.PgConnection@d83a30a, stack trace follows
java.lang.Exception: Apparent connection leak detected
	at com.dotmarketing.db.DbConnectionFactory.getConnection(DbConnectionFactory.java:175) ~[classes/:?]
	at com.dotmarketing.db.HibernateUtil.getSession(HibernateUtil.java:733) ~[classes/:?]
	at com.liferay.portal.ejb.BasePersistence.openSession(BasePersistence.java:19) ~[classes/:?]
	at com.liferay.portal.ejb.ImagePersistence.findByPrimaryKey(ImagePersistence.java:128) ~[classes/:?]
	at com.liferay.portal.ejb.ImageUtil.findByPrimaryKey(ImageUtil.java:128) ~[classes/:?]
	at com.liferay.portal.ejb.ImageManagerImpl.updateImage(ImageManagerImpl.java:76) ~[classes/:?]
	at com.liferay.portal.ejb.ImageManagerUtil.updateImage(ImageManagerUtil.java:87) ~[classes/:?]
	at com.liferay.portal.ejb.ImageLocalUtil.put(ImageLocalUtil.java:78) ~[classes/:?]
	at com.liferay.portal.ejb.CompanyManagerImpl.updateLogo(CompanyManagerImpl.java:173) ~[classes/:?]
	at com.liferay.portal.ejb.CompanyManagerUtil.updateLogo(CompanyManagerUtil.java:168) ~[classes/:?]
	at com.dotcms.rest.CMSConfigResource.saveCompanyLogo(CMSConfigResource.java:311) ~[classes/:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_202]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_202]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_202]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202]
	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) ~[jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) ~[jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) ~[jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160) ~[jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) ~[jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) ~[jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) ~[jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) ~[jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) ~[jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) ~[jersey-common-2.25.1.jar:?]
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) ~[jersey-common-2.25.1.jar:?]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:315) ~[jersey-common-2.25.1.jar:?]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:297) ~[jersey-common-2.25.1.jar:?]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:267) ~[jersey-common-2.25.1.jar:?]
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) ~[jersey-common-2.25.1.jar:?]
	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) ~[jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) ~[jersey-server-2.25.1.jar:?]
	at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473) ~[jersey-container-servlet-core-2.25.1.jar:?]
	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) ~[jersey-container-servlet-core-2.25.1.jar:?]
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) ~[jersey-container-servlet-core-2.25.1.jar:?]
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) ~[jersey-container-servlet-core-2.25.1.jar:?]
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) ~[jersey-container-servlet-core-2.25.1.jar:?]
	at com.dotcms.rest.servlet.ReloadableServletContainer.service(ReloadableServletContainer.java:102) ~[classes/:?]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[catalina.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.32]
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-websocket.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.32]
	at com.dotmarketing.filters.CMSFilter.doFilterInternal(CMSFilter.java:191) ~[classes/:?]
	at com.dotmarketing.filters.CMSFilter.doFilter(CMSFilter.java:47) ~[classes/:?]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.32]
	at com.dotcms.filters.interceptor.AbstractWebInterceptorSupportFilter.doFilter(AbstractWebInterceptorSupportFilter.java:90) ~[classes/:?]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.32]
	at com.dotcms.filters.interceptor.AbstractWebInterceptorSupportFilter.doFilter(AbstractWebInterceptorSupportFilter.java:90) ~[classes/:?]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.32]
	at com.dotmarketing.cms.urlmap.filters.URLMapFilter.doFilter(URLMapFilter.java:98) ~[classes/:?]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.32]
	at com.dotmarketing.filters.VanityURLFilter.doFilter(VanityURLFilter.java:104) ~[classes/:?]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.32]
	at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:399) ~[urlrewritefilter-4.0.4.jar:4.0.4]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.32]
	at com.dotmarketing.filters.TimeMachineFilter.doFilter(TimeMachineFilter.java:134) ~[classes/:?]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.32]
	at com.dotmarketing.filters.ThreadNameFilter.doFilter(ThreadNameFilter.java:88) ~[classes/:?]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.32]
	at com.dotmarketing.filters.CookiesFilter.doFilter(CookiesFilter.java:48) ~[classes/:?]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.32]
	at com.dotmarketing.filters.CharsetEncodingFilter.doFilter(CharsetEncodingFilter.java:99) ~[classes/:?]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.32]
	at com.dotcms.filters.interceptor.AbstractWebInterceptorSupportFilter.doFilter(AbstractWebInterceptorSupportFilter.java:90) ~[classes/:?]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.32]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.32]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ~[catalina.jar:8.5.32]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[catalina.jar:8.5.32]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493) ~[catalina.jar:8.5.32]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) ~[catalina.jar:8.5.32]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) ~[catalina.jar:8.5.32]
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) ~[catalina.jar:8.5.32]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) ~[catalina.jar:8.5.32]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) ~[catalina.jar:8.5.32]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800) ~[tomcat-coyote.jar:8.5.32]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) ~[tomcat-coyote.jar:8.5.32]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:800) ~[tomcat-coyote.jar:8.5.32]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1471) ~[tomcat-coyote.jar:8.5.32]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-coyote.jar:8.5.32]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_202]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_202]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-util.jar:8.5.32]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_202]

@wezell wezell added the Needs Work label Oct 17, 2019
@wezell

This comment has been minimized.

Copy link
Contributor Author

@wezell wezell commented Oct 17, 2019

Note to QA - need to test operations around users and company.

@jgambarios

This comment has been minimized.

Copy link
Contributor

@jgambarios jgambarios commented Oct 23, 2019

PR: #17503

@jgambarios jgambarios removed the Needs Work label Oct 23, 2019
jgambarios added a commit that referenced this issue Oct 23, 2019
* #17428 working, needs testing [travis postgres]

* #17428 user tests passing

* #17428 more removing hibernate

* #17428 testing build

* #17428 fix travis + synchronized build buildSessionFactory

(cherry picked from commit de12e86)
@bryanboza bryanboza added this to In Progress in Release_5.2.1 via automation Oct 24, 2019
@bryanboza bryanboza moved this from In Progress to Ready to Test in Release_5.2.1 Oct 24, 2019
@bryanboza

This comment has been minimized.

Copy link
Collaborator

@bryanboza bryanboza commented Oct 28, 2019

Fixed, tested on the release 5.2.1 // Postgres // FF

@bryanboza bryanboza moved this from Ready to Test to Done in Release_5.2.1 Oct 28, 2019
@wezell wezell closed this Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.