Skip to content

AbstractMessageListenerContainer.refreshSharedConnection [SPR-3059] #7745

Closed

Description

@spring-projects-issues

Alfons Spiegelhauer opened SPR-3059 and commented

Method AbstractMessageListenerContainer.refreshSharedConnection

After line
ConnectionFactoryUtils.releaseConnection(this.sharedConnection, getConnectionFactory(), running);

this.sharedConnection should be set to null.
After the call to ConnectionFactoryUtils.releaseConnection the connection is logically closed

protected final void refreshSharedConnection() throws JMSException {
	boolean running = isRunning();
	synchronized (this.sharedConnectionMonitor) {
		ConnectionFactoryUtils.releaseConnection(this.sharedConnection, getConnectionFactory(), running);

this.sharedConnection = null;

		Connection con = createConnection();
		try {
			prepareSharedConnection(con);
		}
		catch (JMSException ex) {
			JmsUtils.closeConnection(con);
			throw ex;
		}
		this.sharedConnection = con;
	}
}

Affects: 2.0.2

Activity

  1. spring-projects-issues commented on Jan 20, 2007

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    Thanks for spotting this! Indeed, in particular for the exception case, we need to reset the "sharedConnection" variable there.

    Juergen

  2. added
    type: bug
    in: messaging
    on Jan 11, 2019
  3. added this to the 2.0.3 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: messagingtype: bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions