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

        

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to