----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/59330/#review175250 -----------------------------------------------------------
sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java Line 2393 (original), 2394 (patched) <https://reviews.apache.org/r/59330/#comment248704> should we close the query to avoid memory leak? --------------------- based on http://www.datanucleus.org/products/datanucleus/jdo/troubleshooting.html leak The query results are kept in memory until the PersistenceManager or Query are closed. To avoid memory leaks caused by queries in memory, it's capital to explicitly close the query as soon as possible. The following snippet shows how to do it. Query query = pm.newQuery("SELECT FROM org.datanucleus.samples.store.Product WHERE price < :limit"); List results = (List)query.execute(new Double(200.0)); //... //... //closes the query query.closeAll(); sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java Line 2406 (original), 2408 (patched) <https://reviews.apache.org/r/59330/#comment248703> When do we need to detach the objects? If we use the query result, should it be detached? sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java Line 2882 (original), 2892 (patched) <https://reviews.apache.org/r/59330/#comment248702> Set is a collection that contains no duplicate elements. Can we use collection that allows duplicate elements? - Na Li On May 17, 2017, 7:37 a.m., Alexander Kolbasov wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/59330/ > ----------------------------------------------------------- > > (Updated May 17, 2017, 7:37 a.m.) > > > Review request for sentry, Brian Towles, Hao Hao, kalyan kumar kalvagadda, Na > Li, Sergio Pena, and Vamsee Yarlagadda. > > > Bugs: SENTRY-1768 > https://issues.apache.org/jira/browse/SENTRY-1768 > > > Repository: sentry > > > Description > ------- > > SENTRY-1768 Avoid detaching object on transaction exit when it isn't needed > > > Diffs > ----- > > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/DeltaTransactionBlock.java > f590a5296c047e1acedd39a4f2e4f1de98008d32 > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java > ef6786537e9c5f7730bc86d44e8b4a168c20677e > > > Diff: https://reviews.apache.org/r/59330/diff/1/ > > > Testing > ------- > > > Thanks, > > Alexander Kolbasov > >