[
https://issues.apache.org/jira/browse/JAMES-2498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16555346#comment-16555346
]
ASF GitHub Bot commented on JAMES-2498:
---------------------------------------
Github user mbaechler commented on a diff in the pull request:
https://github.com/apache/james-project/pull/132#discussion_r205019941
--- Diff:
server/data/data-jdbc/src/main/java/org/apache/james/mailrepository/jdbc/JDBCMailRepository.java
---
@@ -721,6 +721,27 @@ protected void internalRemove(MailKey key) throws
MessagingException {
}
}
+ @Override
+ public long size() throws MessagingException {
+ Connection conn = null;
--- End diff --
AFAIK all jdbc objects can by handled with a try-with-resource
> JDBCMailRepository should not materialize entities for counting them.
> ---------------------------------------------------------------------
>
> Key: JAMES-2498
> URL: https://issues.apache.org/jira/browse/JAMES-2498
> Project: James Server
> Issue Type: Improvement
> Components: JDBC, MailStore & MailRepository
> Affects Versions: master, 3.2.0
> Reporter: Edgar Asatryan
> Priority: Major
> Labels: performance
>
> *JDBCMailRepository* can significantly save time and memory when
> *JDBCMailRepository#size()* is invoked by executing SQL query.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]