Support Topics Documentation Slack YouTube Blog

Connection 'xxx' was not released in time, for DB: null

I don’t have much more information than this stacktrace:


09:38:59.177 [DEBUG] DbConnectionMonitoring - Connection '04d232a1-22a8-4a03-b71d-daed49654e4f' was not released in time, for DB: null
        java.lang.Thread.getStackTrace(Thread.java:1552)
        com.backendless.db.connection.MonitoredConnection.<init>(MonitoredConnection.java:36)
        com.backendless.db.connection.factory.MonitoringConnectionFactory.getConnection(MonitoringConnectionFactory.java:26)
        com.backendless.db.connection.pool.DbCpConnectionPool.getConnection(DbCpConnectionPool.java:35)
        com.backendless.util.db.DbcpConnectionProviderImpl.getConnection(DbcpConnectionProviderImpl.java:55)
        com.backendless.util.db.MultiTenantConnectionProviderImpl.getAnyConnection(MultiTenantConnectionProviderImpl.java:27)
        com.backendless.util.db.MultiTenantConnectionProviderImpl.getConnection(MultiTenantConnectionProviderImpl.java:41)
        org.hibernate.internal.AbstractSessionImpl$ContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:429)
        org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:84)
        org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getPhysicalConnection(LogicalConnectionManagedImpl.java:109)
        org.hibernate.engine.jdbc.internal.StatementPreparerImpl.connection(StatementPreparerImpl.java:47)
        org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:146)
        org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:172)
        org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:148)
        org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1927)
        org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1896)
        org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1874)
        org.hibernate.loader.Loader.doQuery(Loader.java:919)
        org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:336)
        org.hibernate.loader.Loader.doList(Loader.java:2610)
        org.hibernate.loader.Loader.doList(Loader.java:2593)
        org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2422)
        org.hibernate.loader.Loader.list(Loader.java:2417)
        org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:501)
        org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:371)
        org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216)
        org.hibernate.internal.SessionImpl.list(SessionImpl.java:1339)
        org.hibernate.internal.QueryImpl.list(QueryImpl.java:87)
        org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:606)
        org.hibernate.jpa.internal.QueryImpl.getSingleResult(QueryImpl.java:529)
        com.backendless.datamodel.application.dao.AppVersionDao.findBy(AppVersionDao.java:26)
        com.backendless.servercode.codeModel.ModelCodeExtender.getAppVersion(ModelCodeExtender.java:131)
        com.backendless.servercode.codeModel.ModelCodeExtender.getContext(ModelCodeExtender.java:82)
        com.backendless.services.persistence.common.CustomLogicDecorator.find(CustomLogicDecorator.java:164)
        com.backendless.services.persistence.common.CustomLogicDecorator.find(CustomLogicDecorator.java:29)
        com.backendless.services.persistence.common.PersistenceInterfaceAdapter.find(PersistenceInterfaceAdapter.java:102)
        com.backendless.logging.LogService.getLoggers(LogService.java:403)
        com.backendless.logging.LogService.getLogConfig(LogService.java:95)
        com.backendless.logging.LogService.access$000(LogService.java:43)
        com.backendless.logging.LogService$3$1.apply(LogService.java:327)
        com.backendless.logging.LogService$3$1.apply(LogService.java:323)
        com.backendless.util.SyncUtil.execute(SyncUtil.java:93)
        com.backendless.util.SyncUtil.execute(SyncUtil.java:60)
        com.backendless.logging.LogService$3.run(LogService.java:322)
        java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        java.lang.Thread.run(Thread.java:745)


It appears 5x in the log, 15s after my timer started. The job itself does not complete, nor does it give any error I could catch.

Hello, @Michel Jung
What Backendless distribution do you use?
Artur

Hi Artur,

backendless-3.0.0-24 on AWS EC2 Linux

Could this be connected to:

10:47:26.460 [ERROR] weborb - [WEBORB EXCEPTION] Unable to configure WebORB cluster in EC2


java.lang.NoClassDefFoundError: com/amazonaws/services/s3/AmazonS3
        at weborb.config.AmazonConfig.getData(AmazonConfig.java:40)
        at weborb.config.AmazonConfig.configureCluster(AmazonConfig.java:93)
        at weborb.config.AmazonConfig.configure(AmazonConfig.java:77)
        at weborb.config.ORBServerConfig.init(ORBServerConfig.java:200)
        at weborb.config.ORBServerConfig.<init>(ORBServerConfig.java:106)
        at weborb.config.ORBServerConfig.getORBConfig(ORBServerConfig.java:255)
        at weborb.config.ORBServerConfig.getORBConfig(ORBServerConfig.java:270)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at weborb.config.ORBConfig.getORBConfig(ORBConfig.java:58)
        at weborb.types.Types.addClientClassMapping(Types.java:129)
        at com.backendless.util.GlobalHelper.addClassMapping(GlobalHelper.java:604)
        at com.backendless.util.GlobalHelper.initClassMapping(GlobalHelper.java:582)
        at com.backendless.util.GlobalHelper.start(GlobalHelper.java:225)
        at com.backendless.util.GlobalHelper.onStart(GlobalHelper.java:211)
        at Global$.onStart(Global.scala:11)
        at play.api.GlobalPlugin.onStart(GlobalSettings.scala:220)
        at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)
        at play.api.Play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(Play.scala:91)
        at scala.collection.immutable.List.foreach(List.scala:381)
        at play.api.Play$$anonfun$start$1.apply$mcV$sp(Play.scala:91)
        at play.api.Play$$anonfun$start$1.apply(Play.scala:91)
        at play.api.Play$$anonfun$start$1.apply(Play.scala:91)
        at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
        at play.api.Play$.start(Play.scala:90)
        at play.core.StaticApplication.<init>(ApplicationProvider.scala:55)
        at play.core.server.NettyServer$.createServer(NettyServer.scala:253)
        at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:289)
        at play.core.server.NettyServer$$anonfun$main$3.apply(NettyServer.scala:284)
        at scala.Option.map(Option.scala:146)
        at play.core.server.NettyServer$.main(NettyServer.scala:284)
        at play.core.server.NettyServer.main(NettyServer.scala)
Caused by: java.lang.ClassNotFoundException: com.amazonaws.services.s3.AmazonS3
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 34 more

Hello,
We do not offer free support for standalone, please contact sales@backendless.com to discuss paid plan.
Artur

i am getting the same error. Did you ever figure out how to resolve.

Hi Barry,

What version of Backendless do you have?

Regards,
Mark

Mark,

I am using the Bitnami VM Linux Backendless 3.0.0.27 version. The VM is working at locally out of the box. I uploaded the VM, changed the IP to static, and changed the hostname and now getting this error.

Barry,

3.0.0 is an unsupported version. You need to be at least on 3.5.0 or above to get support.

Regards,
Mark

Hello

We are facing similar situation on BL Pro v4.3.7.

Error appears very close to code publish to BL app, but only from time to time. So sometimes we can push code changes, sometimes we need to rerun job, cause API call didn’t return any answer.

Do you know any possible solution for that?

Nov 16 13:32:02 ip-10-0-1-204 play[8271]: 13:32:02.629 [DEBUG] DbConnectionMonitoring - Connection 'af4fbe38-7282-4f8f-a777-17ba2eabc1cb' was not released in time, for DB: null
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011java.lang.Thread.getStackTrace(Thread.java:1556)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.backendless.db.connection.MonitoredConnection.<init>(MonitoredConnection.java:36)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.backendless.db.connection.factory.MonitoringConnectionFactory.getConnection(MonitoringConnectionFactory.java:20)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.backendless.db.connection.pool.DbCpConnectionPool.getConnection(DbCpConnectionPool.java:35)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.backendless.db.connection.pool.ShardedConnectionPoolManager.getConnection(ShardedConnectionPoolManager.java:51)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.backendless.db.connection.pool.ShardedConnectionPoolManager.getConnection(ShardedConnectionPoolManager.java:45)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.backendless.util.db.DbcpConnectionProviderImpl.getConnection(DbcpConnectionProviderImpl.java:60)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.backendless.util.db.MultiTenantConnectionProviderImpl.getConnection(MultiTenantConnectionProviderImpl.java:41)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011org.hibernate.internal.ContextualJdbcConnectionAccess.obtainConnection(ContextualJdbcConnectionAccess.java:43)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:115)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getPhysicalConnection(LogicalConnectionManagedImpl.java:145)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getConnectionForTransactionManagement(LogicalConnectionManagedImpl.java:263)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.begin(LogicalConnectionManagedImpl.java:271)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.begin(JdbcResourceLocalTrans
actionCoordinatorImpl.java:214)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011org.hibernate.engine.transaction.internal.TransactionImpl.begin(TransactionImpl.java:56)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.backendless.datamodel.dao.AbstractTransaction.begin(AbstractTransaction.java:41)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.backendless.datamodel.dao.JpaTransactionUtil.execute(JpaTransactionUtil.java:79)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.backendless.datamodel.dao.JpaTransactionUtil.execute(JpaTransactionUtil.java:121)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.backendless.datamodel.dao.JpaTransactionUtil.executeAppTransaction(JpaTransactionUtil.java:64)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.backendless.servercode.services.parser.impl.GenericServiceParser.parse(GenericServiceParser.java:111)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.backendless.management.servercode.service.CustomServiceManagement.parseBusinessLogic(CustomServiceManagement.java:289)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.backendless.management.servercode.service.CustomServiceManagement$$EnhancerByGuice$$5620522b.CGLIB$parseBusinessLogic$10(<generated>)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.backendless.management.servercode.service.CustomServiceManagement$$EnhancerByGuice$$5620522b$$FastClassByGuice$$ff208da1.invoke(<generated>)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:76)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.backendless.monitoring.PerformanceMonitoring.invoke(PerformanceMonitoring.java:18)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:77)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:55)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.backendless.management.servercode.service.CustomServiceManagement$$EnhancerByGuice$$5620522b.parseBusinessLogic(<generated>)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011com.backendless.management.servercode.service.CustomServiceManagement.publishCodeToProduction(CustomServiceManagement.java:186)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011controllers.ServerCodeModel.publishCode(ServerCodeModel.java:144)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011router.Routes$$anonfun$routes$1$$anonfun$applyOrElse$488$$anonfun$apply$488.apply(Routes.scala:12748)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011router.Routes$$anonfun$routes$1$$anonfun$applyOrElse$488$$anonfun$apply$488.apply(Routes.scala:12748)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011play.core.routing.HandlerInvokerFactory$$anon$4.resultCall(HandlerInvoker.scala:157)
Nov 16 13:32:02 ip-10-0-1-204 play[8271]: #011play.core.routing.HandlerInvokerFactory$$anon$4.resultCall(HandlerInvoker.scala:156)

Thank you,
Irina

Hello,

This might be due to a timeout configuration. Are you running a licensed installation of Backendless Pro version 6?

Regards,
Mark

Hi,
Our current version is v4.3.7.
I see that message says about db connection, is it related to main mysql db or to mongo?

Which fields can be tuned to fix that?

Hi @Irina_Prozhoha

Connection ‘af4fbe38-7282-4f8f-a777-17ba2eabc1cb’ was not released in time, for DB: null

For Backendless v4.x.x it is expected behavior, and the connection will be released after deploy finished. In latest versions we do not hold connection during deploy process.