activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Anderson (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AMQ-1263) JDBC Master/Slave: After database failure, stale db connections are reused in DefaultdatabaseLocker
Date Mon, 04 Jun 2007 21:45:33 GMT

    [ https://issues.apache.org/activemq/browse/AMQ-1263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39224
] 

Eric Anderson commented on AMQ-1263:
------------------------------------

Note: the patch is for 4.2 SVN 

> JDBC Master/Slave: After database failure, stale db connections are reused in DefaultdatabaseLocker
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-1263
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1263
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Message Store
>    Affects Versions: 4.x
>         Environment: Linux x86, Postgresql 8.1
>            Reporter: Eric Anderson
>         Attachments: patch.txt
>
>
> Start two brokers in a JDBC master/slave configuration.  One will become master, the
other slave.
> Shutdown the database.
> The slave will immediately begin emitting emitting database connection exceptions messages
from the DefaultdatabaseLocker.
> Bring up the database again.
> The slave continues to emit database error messages and all subsequent attempts by the
DefaultdatabaseLocker to issue its locking query will fail.
> The problem is that the DefaultdatabaseLocker grabs one db connection at startup and
never releases it.  Therefore unless the JDBC connection has an auto-reconnect feature, the
slave broker is dead in the water, because its Connection is bad.  The fix is to allocate
a new Connection and PreparedStatement on every iteration of the database locker loop, and
free the statement/connection on any Exception.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message