commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William R. Speirs (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DBUTILS-78) Add asynchronous batch, query, and update calls
Date Mon, 26 Sep 2011 14:21:26 GMT

    [ https://issues.apache.org/jira/browse/DBUTILS-78?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114691#comment-13114691
] 

William R. Speirs commented on DBUTILS-78:
------------------------------------------

Overall looks good! A few things:

1) I cannot think of a case where the Callable which is returned wouldn't simply be placed
on some ExecutorService, but just because I cannot think of a case doesn't mean someone might
not want to do it. If we go with this patch we force people's hand to use an ExecutorService.
Again, I don't think it's a big deal, but I'd to get other people's thoughts.

2) The tests which are failing are all failing because of a check to see if the statement
hasn't been closed after calling batch, update, or query before calling get(). However, now
that we're using an ExecutorService this "get()" call is being executed for us, so the check
is no longer valid. I've removed the check from the test case so that all of the tests now
pass. (Note: we still check to make sure the statements are all properly closed at the end.)

I attached a new patch which includes these changes: DBUTILS-78_Future_v2.patch

Bill-

> Add asynchronous batch, query, and update calls
> -----------------------------------------------
>
>                 Key: DBUTILS-78
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-78
>             Project: Commons DbUtils
>          Issue Type: New Feature
>            Reporter: William R. Speirs
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: 08_16_2011.diff, AsyncQueryRunner.java, AsyncQueryRunnerTest.java,
DBUTILS-78_Future.patch, DBUTILS-78_Future_v2.patch, async.diff, pom.diff
>
>
> I propose a new QueryRunner class, AsyncQueryRunner, which changes the return type of
batch, query, and update methods. Instead of returning their respective return types, the
methods would return a RunnableFuture. This would allow callers to either execute the RunnableFuture
in a thread or via an CompletionService like the ExecutorCompletionService.
> I have attached a first cut at this class.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message