activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jarl <jarl-nabble....@errors.no>
Subject JDBC master/slave failover with DB2 fails due to long-running transaction
Date Tue, 02 Feb 2010 21:33:54 GMT

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.


Mime
View raw message