[ 
https://issues.apache.org/jira/browse/DERBY-6957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16170058#comment-16170058
 ] 

Bryan Pendleton commented on DERBY-6957:
----------------------------------------

Which other code is calling DROP TABLE,and what else is going on in your 
application at that time?

Some other connection is using the table at that moment, and the DROP TABLE 
cannot succeed because the table is in use and cannot be locked.

Here are suggestions for how you can analyse this: 
https://wiki.apache.org/db-derby/LockDebugging

> ERROR 40XL1: A lock could not be obtained within the time requested for alter 
> or truncate table
> -----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-6957
>                 URL: https://issues.apache.org/jira/browse/DERBY-6957
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.13.1.1
>         Environment: production
>            Reporter: SUNEEL KUMAR OLETI
>
> hi,
> for all my Drop table, alter table, truncate table i am getting below error.
> ERROR 40XL1: A lock could not be obtained within the time requested
>       at org.apache.derby.iapi.error.StandardException.newException(Unknown 
> Source)
>       at org.apache.derby.iapi.error.StandardException.newException(Unknown 
> Source)
>       at 
> org.apache.derby.impl.services.locks.ConcurrentLockSet.lockObject(Unknown 
> Source)
>       at org.apache.derby.impl.services.locks.AbstractPool.lockObject(Unknown 
> Source)
>       at 
> org.apache.derby.impl.services.locks.ConcurrentPool.lockObject(Unknown Source)
>       at 
> org.apache.derby.impl.store.raw.xact.ContainerLocking3.lockContainer(Unknown 
> Source)
>       at 
> org.apache.derby.impl.store.raw.data.BaseContainerHandle.useContainer(Unknown 
> Source)
>       at 
> org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(Unknown
>  Source)
>       at 
> org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(Unknown
>  Source)
>       at org.apache.derby.impl.store.raw.xact.Xact.openContainer(Unknown 
> Source)
>       at 
> org.apache.derby.impl.store.access.conglomerate.OpenConglomerate.init(Unknown 
> Source)
>       at org.apache.derby.impl.store.access.heap.Heap.open(Unknown Source)
>       at 
> org.apache.derby.impl.store.access.RAMTransaction.openConglomerate(Unknown 
> Source)
>       at 
> org.apache.derby.impl.store.access.RAMTransaction.openConglomerate(Unknown 
> Source)
>       at 
> org.apache.derby.impl.sql.execute.DDLConstantAction.lockTableForDDL(Unknown 
> Source)
>       at 
> org.apache.derby.impl.sql.execute.AlterTableConstantAction.executeConstantActionBody(Unknown
>  Source)
>       at 
> org.apache.derby.impl.sql.execute.AlterTableConstantAction.executeConstantAction(Unknown
>  Source)
>       at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
>       at 
> org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
>       at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown 
> Source)
>       at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown 
> Source)
>       at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown 
> Source)
>       at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeLargeUpdate(Unknown 
> Source)
>       at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown 
> Source)
>       at com.db.UpdateTables.alterDataTable(UpdateTables.java:1833)
>       at 
> com.he.webApiLayer.ResponseBuilder.insertDataInDB(ResponseBuilder.java:2910)
>       at com.he.webApiLayer.InputAPI.lambda$1(InputAPI.java:127)
>       at spark.RouteImpl$1.handle(RouteImpl.java:61)
>       at spark.http.matching.Routes.execute(Routes.java:61)
>       at spark.http.matching.MatcherFilter.doFilter(MatcherFilter.java:128)
>       at 
> spark.embeddedserver.jetty.JettyHandler.doHandle(JettyHandler.java:50)
>       at 
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
>       at 
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>       at 
> org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
>       at 
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
>       at org.eclipse.jetty.server.Server.handle(Server.java:517)
>       at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
>       at 
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
>       at 
> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)
>       at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
>       at 
> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
>       at 
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
>       at 
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
>       at 
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
>       at 
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
>       at java.lang.Thread.run(Thread.java:745)
> Cleanup action completed



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to