From: Jody G. (JIRA) <ji...@co...> - 2008-01-14 22:47:53
|
ArcSDE Connetion unlocking and/or close --------------------------------------- Key: GEOT-1669 URL: http://jira.codehaus.org/browse/GEOT-1669 Project: GeoTools Issue Type: Bug Components: data arcsde Affects Versions: 2.5-M0 Reporter: Jody Garnett Assignee: Jody Garnett Fix For: 2.5-M1 I got the following patch in my mail today ... amounts to the following: h4. BEFORE {code} final ArcSDEPooledConnection connection = getConnection(); connection.getLock().lock(); try { ... finally { connection.getLock().unlock(); } {code} h4. AFTER {code} final ArcSDEPooledConnection connection = getConnection(); connection.getLock().lock(); try { ... finally { } finally { try { if (!connection.isTransactionActive()) { connection.close(); } } finally { connection.getLock().unlock(); } } } {code} So other than the code being ugly nested try catch statements, the patch looks okay. I would personally isolate this into a lock( ArcSDEPooledConnection ) and unlock( ArcSDEPooledConnection ) method in order to make the code a bit prettier. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |