Hibernate flushing: Could not execute JDBC batch update;Hibernate flushing: Could not execute JDBC batch update;https://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1215434542024-03-29T14:16:02Z2024-03-29T14:16:02ZHibernate flushing: Could not execute JDBC batch update;Fabián Catenahttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1215434532022-10-18T20:20:42Z2022-10-18T13:43:03Z<p>Hi all,</p>
<p> I'm trying to configure Liferay Clustering, it is ready, now I
have 2 mysql instances (Write/Read and other Only-Read) but when I
want to do any kind of update transactions do not work and users are
not able to create/update web content, files, etc, in the portal.</p>
<p>Log of error is:</p>
<p>2022-10-13 13:21:33.126 ERROR
[ajp-nio-8009-exec-27][JDBCExceptionReporter:234] The MySQL server is
running with the --read-only option so it cannot execute this
statement<br /> 2022-10-13 13:21:33.131 ERROR
[ajp-nio-8009-exec-27][PortletServlet:119]
javax.portlet.PortletException:
org.springframework.jdbc.UncategorizedSQLException: Hibernate
flushing: Could not execute JDBC batch update; uncategorized
SQLException for SQL [insert into ExpandoValue (companyId, tableId,
columnId, rowId_, classNameId, classPK, data_, valueId) values (?, ?,
?, ?, ?, ?, ?, ?)]; SQL state [HY000]; error code [1290]; The MySQL
server is running with the --read-only option so it cannot execute
this statement; nested exception is java.sql.BatchUpdateException: The
MySQL server is running with the --read-only option so it cannot
execute this statement<br /> javax.portlet.PortletException:
org.springframework.jdbc.UncategorizedSQLException: Hibernate
flushing: Could not execute JDBC batch update; uncategorized
SQLException for SQL [insert into ExpandoValue (companyId, tableId,
columnId, rowId_, classNameId, classPK, data_, valueId) values (?, ?,
?, ?, ?, ?, ?, ?)]; SQL state [HY000]; error code [1290]; The MySQL
server is running with the --read-only option so it cannot execute
this statement; nested exception is java.sql.BatchUpdateException: The
MySQL server is running with the --read-only option so it cannot
execute this statement<br /> at
com.liferay.portal.kernel.portlet.LiferayPortlet.callActionMethod(LiferayPortlet.java:207)<br />
at
com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.callActionMethod(MVCPortlet.java:401)<br />
at
com.liferay.portal.kernel.portlet.LiferayPortlet.processAction(LiferayPortlet.java:97)<br />
at
com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.processAction(MVCPortlet.java:246)<br />
at
com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:77)<br />
at
com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:50)<br />
at
com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:115)<br />
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)<br />
at
org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)<br />
at
org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62)<br />
at
org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:120)<br />
at
org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)<br />
at
com.liferay.portlet.internal.InvokerPortletImpl.invoke(InvokerPortletImpl.java:573)<br />
at
com.liferay.portlet.internal.InvokerPortletImpl.invokeAction(InvokerPortletImpl.java:620)<br />
at
com.liferay.portlet.internal.InvokerPortletImpl.processAction(InvokerPortletImpl.java:304)<br />
at
com.liferay.portlet.internal.PortletContainerImpl._processAction(PortletContainerImpl.java:524)<br />
at
com.liferay.portlet.internal.PortletContainerImpl.lambda$processAction$0(PortletContainerImpl.java:151)<br />
at
com.liferay.portlet.internal.PortletContainerImpl._preserveGroupIds(PortletContainerImpl.java:427)<br />
at
com.liferay.portlet.internal.PortletContainerImpl.processAction(PortletContainerImpl.java:144)<br />
at
com.liferay.portlet.SecurityPortletContainerWrapper.processAction(SecurityPortletContainerWrapper.java:96)<br />
at
com.liferay.portlet.RestrictPortletContainerWrapper.processAction(RestrictPortletContainerWrapper.java:79)<br />
at
com.liferay.portal.kernel.portlet.PortletContainerUtil.processAction(PortletContainerUtil.java:118)<br />
at
com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:352)<br />
at
com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:174)<br />
at
com.liferay.portal.struts.PortalRequestProcessor._process(PortalRequestProcessor.java:415)<br />
at
com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:155)<br />
at
com.liferay.portal.internal.servlet.MainServlet.doPost(MainServlet.java:213)<br />
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:660)<br />
at
com.liferay.portal.internal.servlet.MainServlet.service(MainServlet.java:639)<br />
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)<br />
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)<br />
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)<br />
at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)<br />
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)<br />
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)<br />
at
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:124)<br />
at
com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:147)<br />
at
com.liferay.portal.servlet.filters.uploadservletrequest.UploadServletRequestFilter.processFilter(UploadServletRequestFilter.java:114)<br />
at
com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)<br />
at
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)<br />
at
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)<br />
at
com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:147)<br />
at
com.liferay.portal.servlet.filters.secure.BaseAuthFilter.processFilter(BaseAuthFilter.java:360)<br />
at
com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)<br />
at
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)<br />
at
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)<br />
at
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:106)<br />
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)<br />
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)<br />
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)<br />
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)<br />
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384)<br />
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)<br />
at
com.liferay.friendly.url.internal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:398)<br />
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)<br />
at
com.liferay.portal.servlet.ServletAdapter.service(ServletAdapter.java:99)<br />
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)<br />
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)<br />
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)<br />
at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)<br />
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)<br />
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)<br />
at
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:124)<br />
at
com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:147)<br />
at
com.liferay.portal.servlet.filters.uploadservletrequest.UploadServletRequestFilter.processFilter(UploadServletRequestFilter.java:114)<br />
at
com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)<br />
at
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)<br />
at
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)<br />
at
com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:147)<br />
at
com.liferay.portal.servlet.filters.secure.BaseAuthFilter.processFilter(BaseAuthFilter.java:360)<br />
at
com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)<br />
at
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)<br />
at
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)<br />
at
com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:147)<br />
at
com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:266)<br />
at
com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)<br />
at
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:215)<br />
at
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)<br />
at
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:196)<br />
at
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:99)<br />
at
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:196)<br />
at
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:99)<br />
at
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:175)<br />
at
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:99)<br />
at
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:106)<br />
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)<br />
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)<br />
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200)<br />
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)<br />
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)<br />
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)<br />
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)<br />
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)<br />
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)<br />
at
org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:394)<br />
at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)<br />
at
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834)<br />
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415)<br />
at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)<br />
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)<br />
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)<br />
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)<br />
at java.lang.Thread.run(Thread.java:748)<br /> Caused by:
org.springframework.jdbc.UncategorizedSQLException: Hibernate
flushing: Could not execute JDBC batch update; uncategorized
SQLException for SQL [insert into ExpandoValue (companyId, tableId,
columnId, rowId_, classNameId, classPK, data_, valueId) values (?, ?,
?, ?, ?, ?, ?, ?)]; SQL state [HY000]; error code [1290]; The MySQL
server is running with the --read-only option so it cannot execute
this statement; nested exception is java.sql.BatchUpdateException: The
MySQL server is running with the --read-only option so it cannot
execute this statement<br /> at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:90)<br />
at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:82)<br />
at
org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:82)<br />
at
org.springframework.orm.hibernate3.HibernateTransactionManager.convertJdbcAccessException(HibernateTransactionManager.java:812)<br />
at
org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:798)<br />
at
org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:671)<br />
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:765)<br />
at
org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:734)<br />
at
com.liferay.portal.spring.transaction.DefaultTransactionExecutor._commit(DefaultTransactionExecutor.java:89)<br />
at
com.liferay.portal.spring.transaction.DefaultTransactionExecutor._execute(DefaultTransactionExecutor.java:136)<br />
at
com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:51)<br />
at
com.liferay.portal.spring.transaction.TransactionInvokerImpl.invoke(TransactionInvokerImpl.java:39)<br />
at
com.liferay.portal.kernel.transaction.TransactionInvokerUtil.invoke(TransactionInvokerUtil.java:28)<br />
at
com.liferay.site.admin.web.internal.portlet.SiteAdminPortlet.editGroup(SiteAdminPortlet.java:261)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)<br /> at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)<br />
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br />
at java.lang.reflect.Method.invoke(Method.java:498)<br />
at
com.liferay.portal.kernel.portlet.LiferayPortlet.callActionMethod(LiferayPortlet.java:189)<br />
... 102 more<br /> Caused by: java.sql.BatchUpdateException:
The MySQL server is running with the --read-only option so it cannot
execute this statement<br /> at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)<br /> at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)<br />
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)<br />
at
java.lang.reflect.Constructor.newInstance(Constructor.java:423)<br />
at
com.mysql.cj.util.Util.handleNewInstance(Util.java:192)<br />
at com.mysql.cj.util.Util.getInstance(Util.java:167)<br /> at
com.mysql.cj.util.Util.getInstance(Util.java:174)<br /> at
com.mysql.cj.jdbc.exceptions.SQLError.createBatchUpdateException(SQLError.java:224)<br />
at
com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchSerially(ClientPreparedStatement.java:855)<br />
at
com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchInternal(ClientPreparedStatement.java:437)<br />
at
com.mysql.cj.jdbc.StatementImpl.executeBatch(StatementImpl.java:814)<br />
at
com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:2437)<br />
at
org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:70)<br />
at
org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:268)<br />
at
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:268)<br />
at
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)<br />
at
org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)<br />
at
com.liferay.portal.dao.orm.hibernate.event.NestableFlushEventListener.onFlush(NestableFlushEventListener.java:61)<br />
at
org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)<br />
at
org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:383)<br />
at
org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:133)<br />
at
org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:663)<br />
... 115 more<br /> Caused by: java.sql.SQLException: The MySQL
server is running with the --read-only option so it cannot execute
this statement<br /> at
com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)<br />
at
com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)<br />
at
com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)<br />
at
com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:955)<br />
at
com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1094)<br />
at
com.mysql.cj.jdbc.ClientPreparedStatement.executeBatchSerially(ClientPreparedStatement.java:834)<br />
... 128 more</p>
<p> </p>
<p>Any idea?</p>
<p>Thanks</p>
<p>Fabián&