diff options
| author | Jeff Brown <jeffbrown@google.com> | 2012-06-22 13:37:57 -0700 |
|---|---|---|
| committer | Jeff Brown <jeffbrown@google.com> | 2012-06-22 15:24:26 -0700 |
| commit | b33eb4e32a25e28677524c68be02ca7034351bf0 (patch) | |
| tree | afcf75f89dfdce4e7f3cdcd7e332c1484a99c29c /docs/html/sdk/api_diff/11 | |
| parent | 880c5f5aea737aee885bc4abee76c11db565f9d7 (diff) | |
Deprecate DatabaseUtils.InsertHelper.
This class does not offer any advantages over SQLiteStatement
and just makes code more complex and error-prone.
Documented that the class is not thread-safe.
Removed a potential deadlock in insert() and replace() caused
by the insertInternal() method being synchronized in the case
where the class was being used concurrently (woe to you!).
Thread A would start a transaction.
Thread B would call insertInternal() and acquire the object monitor,
but block because it could not obtain the db connection because
thread A is holding onto it.
Thread A would call insertInternal() and block because Thread B
was holding the object monitor.
Deadlock.
Changed this code to use a transaction instead of a lock,
which provides the necessary mutual exclusion guarantee without
the potential for a deadlock. Even so, the class really isn't
thread safe.
Bug: 6625094
Change-Id: I51d9a15567a6f2bad6f25e550b48f8f6ffcab2a7
Diffstat (limited to 'docs/html/sdk/api_diff/11')
0 files changed, 0 insertions, 0 deletions
