jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sbarriba" <sbarr...@yahoo.co.uk>
Subject RE: MySql 5.0 & JackRabbit: Connection issues
Date Sun, 15 Jul 2007 16:32:44 GMT
Thanks for the responses.

The MySql doc states
"[autoReconnect] .. is only designed to be used when you are unable to
configure your application to handle SQLExceptions resulting from dead and
stale connections properly. Alternatively, investigate setting the MySQL
server variable "wait_timeout" to some high value rather than the default of
8 hours."

Given that JackRabbit has specific connection requirements which prevent the
use of DBCP or connection pools it would seem necessary for JackRabbit to
provide native support for the equivalent of "validationQuery"
(http://jakarta.apache.org/commons/dbcp/configuration.html) etc to help
defend against connection problems.

I'll let you know the outcome of increasing the wait_timeout.
Regards,
Shaun.


-----Original Message-----
From: Marcel May [mailto:marcel.may@consol.de] 
Sent: 13 July 2007 11:43
To: users@jackrabbit.apache.org
Subject: Re: MySql 5.0 & JackRabbit: Connection issues

If you use an Java EE pool, be aware that the pool/datasource must be
non managed,
as the persistence managers and file systems for Jackrabbit do not use JTA.
Otherwise, you will get problems when the Jackrabbit impl. directly
invokes con.commit or con.setAutoCommit on a managed connection.

Using auto reconnect can be dangerous with mysql (imagine what happens
with an open TX, and a reconnect is performed).
There is an additional JDBC property for reconnecting only at the the
end of a TX (reconnectAtTxEnd).
An auto reconnect for mysql is not recommend (see the docs).

That mysql closes connections by default after 8hrs of inactivity is a pain.
Some firewalls do this often enough, too, for any connection.
BTW, the automatic connection closing is configurable on the mysql
server, so you could inc. the timeout to prevent
over the night/over the weekend timouts caused by inactivity.

There
Cheers,
Marcel

sbarriba wrote:
> Hi all,
>
> We're testing our application using JackRabbit 1.3 with MySql 5.0.27 and
> mysql-connector-java-5.0.6-bin.jar. After the application has been running
> for a period of time we start getting various persistence failures within
> JCR mainly referencing "Connection.close() has already been called". The
> full exception and our workspace persistence configuration are shown
below.
> The app has to be restarted.
>
>  
>
> This situation prompts the question:
>
> .        Are there any other connection related parameters that we should
be
> using for MySql?  Do I need "autoReconnect=true"? I note that this is
> 'false' by default from 5.0.3 onwards
> (http://dev.mysql.com/doc/connector/j/en/auto-reconnect.html)
>
> .        I notice Magnolia are using JNDI instead of the bundle
persistence
> manager. In a previous thread Zukka confirmed "But if you just want to use
> JNDI to externalize the database configuration and understand the
> above-mentioned Jackrabbit usage pattern, then there is no downside to
using
> JNDI"
>
(http://mail-archives.apache.org/mod_mbox/jackrabbit-users/200705.mbox/%3C86
> d42bef0705241018l36d74badpb38dc2b0f0376700@mail.gmail.com%3E) . Can anyone
> confirm if the bundle persistence manager will be much more performant
that
> the JNDI manager? If not, then JNDI would be much more consistent for us.
>
>  
>
> Any other guidance for configuring JackRabbit with MySql 5.0 is
appreciated.
>
> Regards,
>
> Shaun
>
>  
>
> [Workspace Config]
>
>  
>
> <PersistenceManager
>
class="org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager
> ">
>
>           <param name="driver" value="com.mysql.jdbc.Driver"/>
>
>           <param name="url" value="jdbc:mysql://mysql-host:3306/acme"/>
>
>           <param name="schemaObjectPrefix" value="${wsp.name}_"/>
>
>           <param name="user" value="acme"/>
>
>           <param name="password" value="acme"/>
>
>           <param name="schema" value="mysql"/>
>
>           <param name="externalBlobs" value="false"/>
>
>         </PersistenceManager>
>
>  
>
> [Exception Stack]
>
>  
>
> Caused by: org.apache.jackrabbit.core.state.ItemStateException: setting
> autocommit failed.
>
>         at
>
org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.sto
> re(BundleDbPersistenceManager.java:499)
>
>         at
>
org.apache.jackrabbit.core.state.SharedItemStateManager$Update.end(SharedIte
> mStateManager.java:688)
>
>         at
>
org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemSta
> teManager.java:855)
>
>         at
>
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemState
> Manager.java:326)
>
>         at
>
org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManage
> r.java:313)
>
>         at
>
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemState
> Manager.java:302)
>
>         at
>
org.apache.jackrabbit.core.state.SessionItemStateManager.update(SessionItemS
> tateManager.java:306)
>
>         at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1214)
>
>         ... 65 more
>
> Caused by: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException:
> Connection.close() has already been called. Invalid operation in this
state.
>
>         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:888)
>
>         at com.mysql.jdbc.Connection.getMutex(Connection.java:3727)
>
>         at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:5362)
>
>         at
>
org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.sto
> re(BundleDbPersistenceManager.java:494)
>
>         ... 72 more
>
> org.apache.jackrabbit.core.state.ItemStateException: setting autocommit
> failed.
>
>         at
>
org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.sto
> re(BundleDbPersistenceManager.java:499)
>
>         at
>
org.apache.jackrabbit.core.state.SharedItemStateManager$Update.end(SharedIte
> mStateManager.java:688)
>
>         at
>
org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemSta
> teManager.java:855)
>
>         at
>
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemState
> Manager.java:326)
>
>         at
>
org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManage
> r.java:313)
>
>         at
>
org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemState
> Manager.java:302)
>
>         at
>
org.apache.jackrabbit.core.state.SessionItemStateManager.update(SessionItemS
> tateManager.java:306)
>
>         at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1214)
>
>         at org.apache.jackrabbit.core.NodeImpl.lock(NodeImpl.java:4070)
>
>         at
> com.mobileiq.contentrepository.jcr.MIQNodeImpl.lock(MIQNodeImpl.java:343)
>
>         at
>
com.mobileiq.cms.gwt.server.model.RepositoryAccessor.lockItem(RepositoryAcce
> ssor.java:697)
>
>         at
>
com.mobileiq.cms.gwt.server.service.RepositoryAccessorServiceImpl$32.execute
> (RepositoryAccessorServiceImpl.java:792)
>
>         at
>
com.mobileiq.cms.gwt.server.service.RepositoryAccessorServiceImpl.authentica
> teAndExecute(RepositoryAccessorServiceImpl.java:185)
>
>         at
>
com.mobileiq.cms.gwt.server.service.RepositoryAccessorServiceImpl.authentica
> teAndExecute(RepositoryAccessorServiceImpl.java:167)
>
>         at
>
com.mobileiq.cms.gwt.server.service.RepositoryAccessorServiceImpl.lockItem(R
> epositoryAccessorServiceImpl.java:790)
>
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>         at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
> )
>
>         at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
> .java:25)
>
>         at java.lang.reflect.Method.invoke(Method.java:585)
>
>         at
>
org.gwtwidgets.server.spring.enhancer.DelegatingCallback.intercept(Delegatin
> gCallback.java:98)
>
>         at
>
org.gwtwidgets.server.spring.GWTSpringController$$EnhancerByCGLIB$$ca490433.
> lockItem(<generated>)
>
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>         at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
> )
>
>         at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
> .java:25)
>
>         at java.lang.reflect.Method.invoke(Method.java:585)
>
>         at
>
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServic
> eServlet.java:262)
>
>         at
>
org.gwtwidgets.server.spring.GWTSpringController$$EnhancerByCGLIB$$ca490433.
> CGLIB$processCall$3(<generated>)
>
>         at
>
org.gwtwidgets.server.spring.GWTSpringController$$EnhancerByCGLIB$$ca490433$
> $FastClassByCGLIB$$eae5dacf.invoke(<generated>)
>
>         at
net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
>
>         at
>
org.gwtwidgets.server.spring.enhancer.DelegatingCallback.intercept(Delegatin
> gCallback.java:103)
>
>         at
>
org.gwtwidgets.server.spring.GWTSpringController$$EnhancerByCGLIB$$ca490433.
> processCall(<generated>)
>
>         at
>
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServ
> let.java:146)
>
>         at
>
org.gwtwidgets.server.spring.GWTSpringController.handleRequest(GWTSpringCont
> roller.java:73)
>
>         at
>
org.gwtwidgets.server.spring.GWTSpringController$$EnhancerByCGLIB$$ca490433.
> CGLIB$handleRequest$1(<generated>)
>
>         at
>
org.gwtwidgets.server.spring.GWTSpringController$$EnhancerByCGLIB$$ca490433$
> $FastClassByCGLIB$$eae5dacf.invoke(<generated>)
>
>         at
net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
>
>         at
>
org.gwtwidgets.server.spring.enhancer.DelegatingCallback.intercept(Delegatin
> gCallback.java:103)
>
>         at
>
org.gwtwidgets.server.spring.GWTSpringController$$EnhancerByCGLIB$$ca490433.
> handleRequest(<generated>)
>
>         at
>
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(Si
> mpleControllerHandlerAdapter.java:45)
>
>         at
>
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServl
> et.java:820)
>
>         at
>
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServle
> t.java:755)
>
>         at
>
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkSer
> vlet.java:396)
>
>         at
>
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.jav
> a:360)
>
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>
>         at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:252)
>
>         at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:173)
>
>         at
>
com.mobileiq.contentrepository.springmodule.http.TransactionSynchronizationF
> ilter.doFilterInternal(TransactionSynchronizationFilter.java:98)
>
>         at
>
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestF
> ilter.java:77)
>
>         at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:202)
>
>         at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:173)
>
>         at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:214)
>
>         at
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
> t.java:104)
>
>         at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>
>         at
>
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
> Valve.java:198)
>
>         at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:152)
>
>         at
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
> t.java:104)
>
>         at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>
>         at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137
> )
>
>         at
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
> t.java:104)
>
>         at
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118
> )
>
>         at
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
> t.java:102)
>
>         at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>
>         at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> :109)
>
>         at
>
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
> t.java:104)
>
>         at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
>
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
>
>         at
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
>
>         at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
>
>         at
>
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
> ction(Http11Protocol.java:705)
>
>         at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
>
>         at
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
> a:684)
>
>         at java.lang.Thread.run(Thread.java:595)
>
> Caused by: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException:
> Connection.close() has already been called. Invalid operation in this
state.
>
>         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:888)
>
>         at com.mysql.jdbc.Connection.getMutex(Connection.java:3727)
>
>         at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:5362)
>
>         at
>
org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.sto
> re(BundleDbPersistenceManager.java:494)
>
>         ... 72 more
>
>  
>
>  
>
>
>   


-- 
Marcel May

ConSol* Software GmbH
Franziskanerstr. 38
81669 M√ľnchen 

Tel: +49 (0)89-45841-155
Fax: +49-(0)89-45841-111
marcel.may@consol.de
http://www.consol.de


Mime
View raw message