You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Raj_New <rs...@yahoo.co.in> on 2009/04/27 10:46:58 UTC
[ActiveMQ Cleanup Timer]
(org.apache.activemq.store.jdbc.DefaultDatabaseLocker:keepAlive:123) -
Failed to update database lock:
I am getting this error using embedded broker of AMQ5.2. Database driver is
db2. please suggest me how could I remove this error. I hope their are some
configuration enteries that I am missing in activemq.xml.
[4/26/09 20:13:19:769 CDT] 0000002f SystemOut O ERROR [ActiveMQ Cleanup
Timer] (org.apache.activemq.store.jdbc.DefaultDatabaseLocker:keepAlive:123)
- Failed to update database lock: com.ibm.db2.jcc.b.SqlException: DB2 SQL
error: SQLCODE: -964, SQLSTATE: 57011, SQLERRMC: null
com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -964, SQLSTATE:
57011, SQLERRMC: null
at java.sql.SQLException.<init>(Unknown Source)
at com.ibm.db2.jcc.b.SqlException.<init>(SqlException.java:71)
at com.ibm.db2.jcc.b.zc.d(zc.java:1351)
at com.ibm.db2.jcc.a.db.l(db.java:366)
at com.ibm.db2.jcc.a.db.a(db.java:64)
at com.ibm.db2.jcc.a.r.a(r.java:48)
at com.ibm.db2.jcc.a.tb.c(tb.java:266)
at com.ibm.db2.jcc.b.ad.Z(ad.java:1666)
at com.ibm.db2.jcc.b.ad.d(ad.java:2224)
at com.ibm.db2.jcc.b.ad.V(ad.java:521)
at com.ibm.db2.jcc.b.ad.executeUpdate(ad.java:504)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:94)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:94)
at
org.apache.activemq.store.jdbc.DefaultDatabaseLocker.keepAlive(DefaultDatabaseLocker.java:118)
at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.databaseLockKeepAlive(JDBCPersistenceAdapter.java:481)
at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter$1.run(JDBCPersistenceAdapter.java:183)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:452)
at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:328)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:161)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:109)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:192)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:216)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:896)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:735)
[4/26/09 20:13:19:769 CDT] 0000002f SystemOut O INFO [ActiveMQ Cleanup
Timer]
(org.apache.activemq.store.jdbc.JDBCPersistenceAdapter:stopBroker:495) - No
longer able to keep the exclusive lock so giving up being a master
[4/26/09 20:13:19:769 CDT] 0000002f SystemOut O INFO [ActiveMQ Cleanup
Timer] (org.apache.activemq.broker.BrokerService:stop:505) - ActiveMQ
Message Broker (localhost, ID:cscdevdal001-1150-1240269302749-0:0) is
shutting down
[4/26/09 20:13:22:878 CDT] 0000002f SystemOut O INFO [ActiveMQ Cleanup
Timer] (org.apache.activemq.broker.TransportConnector:stop:273) - Connector
openwire Stopped
[4/26/09 20:13:26:503 CDT] 0000002f SystemOut O INFO [ActiveMQ Cleanup
Timer] (org.apache.activemq.broker.BrokerService:stop:542) - ActiveMQ JMS
Message Broker (localhost, ID:cscdevdal001-1150-1240269302749-0:0) stopped
--
View this message in context: http://www.nabble.com/-ActiveMQ-Cleanup-Timer--%28org.apache.activemq.store.jdbc.DefaultDatabaseLocker%3AkeepAlive%3A123%29---Failed-to-update-database-lock%3A-tp23252301p23252301.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: [solved] JDBC master/slave failover with DB2 fails due to
long-running transaction
Posted by Jarl <ja...@errors.no>.
After browsing code and bug reports for some hours, and doing some testing;
it seems all that is required is to set the (undocumented) configuration
property lockKeepAlivePeriod to 0, thus disabling the frequent updates.
This used to be the default but was changed to 30 seconds in 5.1/5.2. There
seems to be no ill effects in turning it off, so hopefully we're off the
hook.
<persistenceAdapter>
<jdbcPersistenceAdapter dataSource="#db2-ds" lockKeepAlivePeriod="0"/>
</persistenceAdapter>
Thanks!
-Jarl
Jarl wrote:
>
> We are running ActiveMQ 5.3.0 with a basic master/slave failover with JDBC
> persistence and database locking against a DB2 9.x database.
>
> It seems DefaultDatabaseLocker gradually fills the transaction log
> (frequent updates, no commits), causing a regular failover. Increasing
> transaction log size to 1GB gives us about 48 hours uptime before
> failover.
>
> I see this was brought up in april with no apparent resolution. Any
> pointers before we delve in and patch this ourselves? Is there some
> configuration we might have missed out on?
>
--
View this message in context: http://old.nabble.com/-ActiveMQ-Cleanup-Timer--%28org.apache.activemq.store.jdbc.DefaultDatabaseLocker%3AkeepAlive%3A123%29---Failed-to-update-database-lock%3A-tp23252301p27452224.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
JDBC master/slave failover with DB2 fails due to long-running
transaction
Posted by Jarl <ja...@errors.no>.
We are running ActiveMQ 5.3.0 with a basic master/slave failover with JDBC
persistence and database locking against a DB2 9.x database.
It seems DefaultDatabaseLocker gradually fills the transaction log (frequent
updates, no commits), causing a regular failover. Increasing transaction log
size to 1GB gives us about 48 hours uptime before failover.
I see this was brought up in april with no apparent resolution. Any pointers
before we delve in and patch this ourselves? Is there some configuration we
might have missed out on?
Vyrdsamt,
-Jarl
Raj_New wrote:
>
> I have gone through AMQ 5.2 source code and found following particular
> section where I am geetting exception. The exception is thrown after
> couple of days running my applicaton successfully.
>
> Any idea how to avoid it???
>
> DefaultDatabaseLocker.java
>
> public boolean keepAlive() {
> PreparedStatement statement = null;
> boolean result = false;
> try {
> statement =
> connection.prepareStatement(statements.getLockUpdateStatement());
> statement.setLong(1, System.currentTimeMillis());
> int rows = statement.executeUpdate();
> if (rows == 1) {
> result=true;
> }
> } catch (Exception e) {
> LOG.error("Failed to update database lock: " + e, e);
> }finally {
> if (statement != null) {
> try {
> statement.close();
> } catch (SQLException e) {
> LOG.error("Failed to close statement",e);
> }
> }
> }
> return result;
> }
>
>
> Raj_New wrote:
>>
>> I am getting this error using embedded broker of AMQ5.2 which is causing
>> to shut down the broker. Database driver is db2. please suggest me how
>> could I remove this error. I hope their are some configuration enteries
>> that I am missing in activemq.xml.
>>
>> [4/26/09 20:13:19:769 CDT] 0000002f SystemOut O ERROR [ActiveMQ
>> Cleanup Timer]
>> (org.apache.activemq.store.jdbc.DefaultDatabaseLocker:keepAlive:123) -
>> Failed to update database lock: com.ibm.db2.jcc.b.SqlException: DB2 SQL
>> error: SQLCODE: -964, SQLSTATE: 57011, SQLERRMC: null
>> com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -964, SQLSTATE:
>> 57011, SQLERRMC: null
>> at java.sql.SQLException.<init>(Unknown Source)
>> at com.ibm.db2.jcc.b.SqlException.<init>(SqlException.java:71)
>> ...
>> at
>> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:94)
>> at
>> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:94)
>> at
>> org.apache.activemq.store.jdbc.DefaultDatabaseLocker.keepAlive(DefaultDatabaseLocker.java:118)
>> ...
>
>
--
View this message in context: http://old.nabble.com/-ActiveMQ-Cleanup-Timer--%28org.apache.activemq.store.jdbc.DefaultDatabaseLocker%3AkeepAlive%3A123%29---Failed-to-update-database-lock%3A-tp23252301p27427747.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: [ActiveMQ Cleanup Timer]
(org.apache.activemq.store.jdbc.DefaultDatabaseLocker:keepAlive:123) -
Failed to update database lock:
Posted by Raj_New <rs...@yahoo.co.in>.
I have gone through AMQ 5.2 source code and found following particular
section where I am geetting exception. The exception is thrown after couple
of days running my applicaton successfully.
Any idea how to avoid it???
DefaultDatabaseLocker.java
public boolean keepAlive() {
PreparedStatement statement = null;
boolean result = false;
try {
statement =
connection.prepareStatement(statements.getLockUpdateStatement());
statement.setLong(1, System.currentTimeMillis());
int rows = statement.executeUpdate();
if (rows == 1) {
result=true;
}
} catch (Exception e) {
LOG.error("Failed to update database lock: " + e, e);
}finally {
if (statement != null) {
try {
statement.close();
} catch (SQLException e) {
LOG.error("Failed to close statement",e);
}
}
}
return result;
}
Raj_New wrote:
>
> I am getting this error using embedded broker of AMQ5.2 which is causing
> to shut down the broker. Database driver is db2. please suggest me how
> could I remove this error. I hope their are some configuration enteries
> that I am missing in activemq.xml.
>
> [4/26/09 20:13:19:769 CDT] 0000002f SystemOut O ERROR [ActiveMQ
> Cleanup Timer]
> (org.apache.activemq.store.jdbc.DefaultDatabaseLocker:keepAlive:123) -
> Failed to update database lock: com.ibm.db2.jcc.b.SqlException: DB2 SQL
> error: SQLCODE: -964, SQLSTATE: 57011, SQLERRMC: null
> com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -964, SQLSTATE:
> 57011, SQLERRMC: null
> at java.sql.SQLException.<init>(Unknown Source)
> at com.ibm.db2.jcc.b.SqlException.<init>(SqlException.java:71)
> at com.ibm.db2.jcc.b.zc.d(zc.java:1351)
> at com.ibm.db2.jcc.a.db.l(db.java:366)
> at com.ibm.db2.jcc.a.db.a(db.java:64)
> at com.ibm.db2.jcc.a.r.a(r.java:48)
> at com.ibm.db2.jcc.a.tb.c(tb.java:266)
> at com.ibm.db2.jcc.b.ad.Z(ad.java:1666)
> at com.ibm.db2.jcc.b.ad.d(ad.java:2224)
> at com.ibm.db2.jcc.b.ad.V(ad.java:521)
> at com.ibm.db2.jcc.b.ad.executeUpdate(ad.java:504)
> at
> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:94)
> at
> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:94)
> at
> org.apache.activemq.store.jdbc.DefaultDatabaseLocker.keepAlive(DefaultDatabaseLocker.java:118)
> at
> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.databaseLockKeepAlive(JDBCPersistenceAdapter.java:481)
> at
> org.apache.activemq.store.jdbc.JDBCPersistenceAdapter$1.run(JDBCPersistenceAdapter.java:183)
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:452)
> at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:328)
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:161)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:109)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:192)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:216)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:896)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
> at java.lang.Thread.run(Thread.java:735)
> [4/26/09 20:13:19:769 CDT] 0000002f SystemOut O INFO [ActiveMQ
> Cleanup Timer]
> (org.apache.activemq.store.jdbc.JDBCPersistenceAdapter:stopBroker:495) -
> No longer able to keep the exclusive lock so giving up being a master
> [4/26/09 20:13:19:769 CDT] 0000002f SystemOut O INFO [ActiveMQ
> Cleanup Timer] (org.apache.activemq.broker.BrokerService:stop:505) -
> ActiveMQ Message Broker (localhost,
> ID:cscdevdal001-1150-1240269302749-0:0) is shutting down
> [4/26/09 20:13:22:878 CDT] 0000002f SystemOut O INFO [ActiveMQ
> Cleanup Timer] (org.apache.activemq.broker.TransportConnector:stop:273) -
> Connector openwire Stopped
> [4/26/09 20:13:26:503 CDT] 0000002f SystemOut O INFO [ActiveMQ
> Cleanup Timer] (org.apache.activemq.broker.BrokerService:stop:542) -
> ActiveMQ JMS Message Broker (localhost,
> ID:cscdevdal001-1150-1240269302749-0:0) stopped
>
--
View this message in context: http://www.nabble.com/-ActiveMQ-Cleanup-Timer--%28org.apache.activemq.store.jdbc.DefaultDatabaseLocker%3AkeepAlive%3A123%29---Failed-to-update-database-lock%3A-tp23252301p23259064.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.