beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Yu (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (BEAM-1962) Connection should be closed in case start() throws exception
Date Sun, 07 May 2017 14:31:04 GMT

     [ https://issues.apache.org/jira/browse/BEAM-1962?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ted Yu updated BEAM-1962:
-------------------------
    Description: 
In JmsIO#start() :
{code}
      try {
        Connection connection;
        if (spec.getUsername() != null) {
          connection =
              connectionFactory.createConnection(spec.getUsername(), spec.getPassword());
        } else {
          connection = connectionFactory.createConnection();
        }
        connection.start();
        this.connection = connection;
      } catch (Exception e) {
        throw new IOException("Error connecting to JMS", e);
      }
{code}
If start() throws exception, connection should be closed.

  was:
In JmsIO#start() :

{code}
      try {
        Connection connection;
        if (spec.getUsername() != null) {
          connection =
              connectionFactory.createConnection(spec.getUsername(), spec.getPassword());
        } else {
          connection = connectionFactory.createConnection();
        }
        connection.start();
        this.connection = connection;
      } catch (Exception e) {
        throw new IOException("Error connecting to JMS", e);
      }
{code}
If start() throws exception, connection should be closed.


> Connection should be closed in case start() throws exception
> ------------------------------------------------------------
>
>                 Key: BEAM-1962
>                 URL: https://issues.apache.org/jira/browse/BEAM-1962
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-extensions
>            Reporter: Ted Yu
>            Assignee: Jean-Baptiste Onofré
>            Priority: Minor
>
> In JmsIO#start() :
> {code}
>       try {
>         Connection connection;
>         if (spec.getUsername() != null) {
>           connection =
>               connectionFactory.createConnection(spec.getUsername(), spec.getPassword());
>         } else {
>           connection = connectionFactory.createConnection();
>         }
>         connection.start();
>         this.connection = connection;
>       } catch (Exception e) {
>         throw new IOException("Error connecting to JMS", e);
>       }
> {code}
> If start() throws exception, connection should be closed.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message