[jboss-jira] [JBoss JIRA] Updated: (JBMESSAGING-511) JDBC and Transaction close/cleanup operations should be bullet-proofed in JDBCChannelMapper and elsewhere.

Tim Fox (JIRA) jira-events at lists.jboss.org
Wed Apr 18 15:25:45 EDT 2007


     [ http://jira.jboss.com/jira/browse/JBMESSAGING-511?page=all ]

Tim Fox updated JBMESSAGING-511:
--------------------------------

    Assignee:     (was: Ovidiu Feodorov)

> JDBC and Transaction close/cleanup operations should be bullet-proofed in JDBCChannelMapper and elsewhere.
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: JBMESSAGING-511
>                 URL: http://jira.jboss.com/jira/browse/JBMESSAGING-511
>             Project: JBoss Messaging
>          Issue Type: Bug
>          Components: Messaging Core
>    Affects Versions: 1.0.1.CR4
>         Environment: Windows
>            Reporter: Joel Lindheimer
>             Fix For: Unscheduled
>
>
> I am concerned with object close and wrap.end() methods in JDBCChannelMapper possibly being bypassed if an exception is thrown in the rs.close(), ps.close() blocks (code below is an example of what is currently in the JDBCChannelMapper).   
> JDBCChannelMapper :
> public DurableSubscription getDurableSubscription(String clientID,  String subscriptionName, MessageStore ms, PersistenceManager pm, MemoryManager mm) throws Exception {
>       // Look in memory first
>       DurableSubscription sub = getDurableSubscription(clientID, subscriptionName);
>       if (sub != null) {
>          return sub;
>       }
>       //Now look in the db        
>       Connection conn = null;
>       PreparedStatement ps  = null;
>       ResultSet rs = null;
>       TransactionWrapper wrap = new TransactionWrapper();
>       try {
>          conn = ds.getConnection();
>          ps = conn.prepareStatement(selectDurableSub);
>      (do stuff here... )    
>          return sub;
>       } finally {
>          if (rs != null) {  // JL what if it blose up here?
>             rs.close();
>          }
>          if (ps != null)  { // JL or here?
>             ps.close();
>          }
>          if (conn != null)  { // or here?
>             conn.close();
>          }
>          wrap.end();
>       }      
>    }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list