0

我通过 parse.com 同步数据。同步完成后,加载访问 SQLite 数据库所需的数据。我可以确保所有游标都已关闭。这是日志:

10-23 10:05:02.642: E/StrictMode(31170): A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
10-23 10:05:02.642: E/StrictMode(31170): java.lang.Throwable: Explicit termination method 'close' not called
10-23 10:05:02.642: E/StrictMode(31170): at dalvik.system.CloseGuard.open(CloseGuard.java:184)
10-23 10:05:02.642: E/StrictMode(31170): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:277)
10-23 10:05:02.642: E/StrictMode(31170): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.getSession(OpenSSLSocketImpl.java:725)
10-23 10:05:02.642: E/StrictMode(31170): at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:92)
10-23 10:05:02.642: E/StrictMode(31170): at org.apache.http.conn.ssl.SSLSocketFactory.createSocket(SSLSocketFactory.java:388)
10-23 10:05:02.642: E/StrictMode(31170): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:165)
10-23 10:05:02.642: E/StrictMode(31170): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
10-23 10:05:02.642: E/StrictMode(31170): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
10-23 10:05:02.642: E/StrictMode(31170): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
10-23 10:05:02.642: E/StrictMode(31170): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
10-23 10:05:02.642: E/StrictMode(31170): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
10-23 10:05:02.642: E/StrictMode(31170): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
10-23 10:05:02.642: E/StrictMode(31170): at com.parse.ParseCommand$6.call(ParseCommand.java:425)
10-23 10:05:02.642: E/StrictMode(31170): at com.parse.ParseCommand$6.call(ParseCommand.java:1)
10-23 10:05:02.642: E/StrictMode(31170): at com.parse.Task$3.run(Task.java:225)
10-23 10:05:02.642: E/StrictMode(31170): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
10-23 10:05:02.642: E/StrictMode(31170): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
10-23 10:05:02.642: E/StrictMode(31170): at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:153)
10-23 10:05:02.642: E/StrictMode(31170): at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
10-23 10:05:02.642: E/StrictMode(31170): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
10-23 10:05:02.642: E/StrictMode(31170): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
10-23 10:05:02.642: E/StrictMode(31170): at java.lang.Thread.run(Thread.java:841)
4

1 回答 1

0

使用 StrictMode 可能会为您提供导致问题误报的信息。请参阅SO question 并决定何时需要关闭数据库连接。

于 2013-11-06T02:42:33.960 回答