db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-6285) Use factory method to create thread pool for timed login
Date Mon, 01 Jul 2013 15:17:20 GMT

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

Knut Anders Hatlen updated DERBY-6285:
--------------------------------------

    Attachment: derby-6285-1a.diff

The attached patch replaces the explicit call to ThreadPoolExecutor's constructor with a call
to Executors.newCachedThreadPool().

The implementation of newCachedThreadPool() in OpenJDK 7 calls ThreadPoolExecutor's constructor
with the exact same arguments as the original code in InternalDriver, so the behaviour before
and after the patch should be identical on that platform at least.

All regression tests ran cleanly with the patch in my environment.
                
> Use factory method to create thread pool for timed login
> --------------------------------------------------------
>
>                 Key: DERBY-6285
>                 URL: https://issues.apache.org/jira/browse/DERBY-6285
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC
>    Affects Versions: 10.10.1.1
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Trivial
>         Attachments: derby-6285-1a.diff
>
>
> InternalDriver creates a thread pool for running timed logins like this:
>     private static final ThreadPoolExecutor _executorPool =
>             new ThreadPoolExecutor(0, Integer.MAX_VALUE, 60L, TimeUnit.SECONDS,
>                                    new SynchronousQueue<Runnable>());
>     static {
>         _executorPool.setThreadFactory(new DaemonThreadFactory());
>     }
> The java.util.concurrent.Executors class has factory methods that create thread pools
and hide the details such as choosing keep-alive time and which kind of queue to use.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message