You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by pkorwar <pk...@yahoo.com> on 2013/07/10 16:15:41 UTC

Activemq 5.8 problem with Oracle jdbc adapter

I am using ActiveMQ 5.8 with Oracle as persistent store.
I keep getting the following exception saying that it could not get the DB
lock.
Has anybody faced this issue? Does it have to do with configuration
settings?
I have pasted the exception below.

Thanks
Pramod
--------------------
2013-07-09 17:06:55,676 | ERROR | Failed to update database lock:
java.sql.SQLException: ORA-01013: user requested cancel of current operation
 | org.apache.activemq.store.jdbc.DefaultDatabaseLocker | ActiveMQ Cleanup
Timer
java.sql.SQLException: ORA-01013: user requested cancel of current operation

        at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
        at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
        at
oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
        at
oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:955)
        at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1169)
        at
oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
        at
oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3368)
        at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
        at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
        at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
        at
org.apache.activemq.store.jdbc.DefaultDatabaseLocker.keepAlive(DefaultDatabaseLocker.java:184)
        at
org.apache.activemq.broker.LockableServiceSupport.keepLockAlive(LockableServiceSupport.java:115)
        at
org.apache.activemq.broker.LockableServiceSupport$1.run(LockableServiceSupport.java:88)
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
        at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
2013-07-09 17:06:55,678 | INFO  | localhost, no longer able to keep the
exclusive lock so giving up being a master |
org.apache.activemq.broker.LockableServiceSupport | ActiveMQ Cleanup Timer
2013-07-09 17:06:55,678 | INFO  | Apache ActiveMQ 5.8.0 (localhost,
ID:cbdn-000-000-001-016-49266-1373388014812-0:1) is shutting down |
org.apache.activemq.broker.BrokerService | ActiveMQ Cleanup Timer




--
View this message in context: http://activemq.2283324.n4.nabble.com/Activemq-5-8-problem-with-Oracle-jdbc-adapter-tp4669080.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Activemq 5.8 problem with Oracle jdbc adapter

Posted by pkorwar <pk...@yahoo.com>.
Presently I am not using Master/Slave, but we do intend to use it soon. So, I
will try the lease locker and see what happens. Thanks for the response.

Pramod



--
View this message in context: http://activemq.2283324.n4.nabble.com/Activemq-5-8-problem-with-Oracle-jdbc-adapter-tp4669080p4669133.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Activemq 5.8 problem with Oracle jdbc adapter

Posted by Gary Tully <ga...@gmail.com>.
the database-locker uses a long running transaction to maintain
exclusive access to a database table. If you are not using maste/slave
then you can disable the use of the lock altogether, boolean attribute
on the jdbc persistence adapter.
The long running transaction has the problem of building up a large
transaction log over time. One solution is to use a separate db for
the lock table. tha lock data source is separately configurable.
in your case it looks like the query is timing out so possibly that
config will help if that is your only problem.

A per SuoNayi's succession. the lease locker provides an alternative
polling lock that does not require a long running transaction.

There is some detail on lockers at:
http://activemq.apache.org/pluggable-storage-lockers.html

On 10 July 2013 17:48, pkorwar <pk...@yahoo.com> wrote:
> Hi gtully,
>
> Somebody had posted a solution to this problem which sets the following
> configuration for jdbc adapter.
>
> Is this a good solution to prevent the DB lock issue? What does it actually
> do?
>
> <jdbcPersistenceAdapter ... >
>         <databaseLocker>
>                 <database-locker queryTimeout="-1" />
>         </databaseLocker>
> </jdbcPersistenceAdapter>
>
> Thanks
> Pramod
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Activemq-5-8-problem-with-Oracle-jdbc-adapter-tp4669080p4669093.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
http://redhat.com
http://blog.garytully.com

Re: Re:Re: Activemq 5.8 problem with Oracle jdbc adapter

Posted by pkorwar <pk...@yahoo.com>.
Thanks for the recommendation !

pramod



--
View this message in context: http://activemq.2283324.n4.nabble.com/Activemq-5-8-problem-with-Oracle-jdbc-adapter-tp4669080p4669135.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re:Re: Activemq 5.8 problem with Oracle jdbc adapter

Posted by SuoNayi <su...@163.com>.
Do not do that, I recommend you to use lease lock to instead of the default long-lived row lock.




At 2013-07-11 00:48:26,pkorwar <pk...@yahoo.com> wrote:
>Hi gtully,
>
>Somebody had posted a solution to this problem which sets the following
>configuration for jdbc adapter.
>
>Is this a good solution to prevent the DB lock issue? What does it actually
>do?
>
><jdbcPersistenceAdapter ... >
>        <databaseLocker>
>                <database-locker queryTimeout="-1" />
>        </databaseLocker>
></jdbcPersistenceAdapter>
>
>Thanks
>Pramod
>
>
>
>--
>View this message in context: http://activemq.2283324.n4.nabble.com/Activemq-5-8-problem-with-Oracle-jdbc-adapter-tp4669080p4669093.html
>Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Activemq 5.8 problem with Oracle jdbc adapter

Posted by pkorwar <pk...@yahoo.com>.
Hi gtully,

Somebody had posted a solution to this problem which sets the following
configuration for jdbc adapter.

Is this a good solution to prevent the DB lock issue? What does it actually
do?

<jdbcPersistenceAdapter ... >
        <databaseLocker>
                <database-locker queryTimeout="-1" />
        </databaseLocker>
</jdbcPersistenceAdapter>

Thanks
Pramod



--
View this message in context: http://activemq.2283324.n4.nabble.com/Activemq-5-8-problem-with-Oracle-jdbc-adapter-tp4669080p4669093.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Activemq 5.8 problem with Oracle jdbc adapter

Posted by Gary Tully <ga...@gmail.com>.
maybe try and reproduce with trace level logging for the broker and
post the results, some more context may help diagnose.

On 10 July 2013 15:15, pkorwar <pk...@yahoo.com> wrote:
>
> I am using ActiveMQ 5.8 with Oracle as persistent store.
> I keep getting the following exception saying that it could not get the DB
> lock.
> Has anybody faced this issue? Does it have to do with configuration
> settings?
> I have pasted the exception below.
>
> Thanks
> Pramod
> --------------------
> 2013-07-09 17:06:55,676 | ERROR | Failed to update database lock:
> java.sql.SQLException: ORA-01013: user requested cancel of current operation
>  | org.apache.activemq.store.jdbc.DefaultDatabaseLocker | ActiveMQ Cleanup
> Timer
> java.sql.SQLException: ORA-01013: user requested cancel of current operation
>
>         at
> oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
>         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
>         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
>         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
>         at
> oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
>         at
> oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:955)
>         at
> oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1169)
>         at
> oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
>         at
> oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3368)
>         at
> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
>         at
> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
>         at
> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
>         at
> org.apache.activemq.store.jdbc.DefaultDatabaseLocker.keepAlive(DefaultDatabaseLocker.java:184)
>         at
> org.apache.activemq.broker.LockableServiceSupport.keepLockAlive(LockableServiceSupport.java:115)
>         at
> org.apache.activemq.broker.LockableServiceSupport$1.run(LockableServiceSupport.java:88)
>         at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
>         at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
>         at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
>         at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
>         at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
>         at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:662)
> 2013-07-09 17:06:55,678 | INFO  | localhost, no longer able to keep the
> exclusive lock so giving up being a master |
> org.apache.activemq.broker.LockableServiceSupport | ActiveMQ Cleanup Timer
> 2013-07-09 17:06:55,678 | INFO  | Apache ActiveMQ 5.8.0 (localhost,
> ID:cbdn-000-000-001-016-49266-1373388014812-0:1) is shutting down |
> org.apache.activemq.broker.BrokerService | ActiveMQ Cleanup Timer
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Activemq-5-8-problem-with-Oracle-jdbc-adapter-tp4669080.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
http://redhat.com
http://blog.garytully.com