In my Android application, AsyncTask has been running for quite some time. I start updating the database when the application starts. I need to wrap this in a transaction to drop back if the user exits the application before the task is completed. However, since wrapping the code in a transaction blocks ui until the task is completed. Why is this happening because the code is already running in a separate thread?
I use ORMLite, and this transaction shell is basically, the code for updating db goes inside call () .., before adding the code for updating db inside the transaction there was no ui lock ...
public ConnectionSource source; @Override protected Boolean doInBackground(Context... params) { try { TransactionManager.callInTransaction(source, new Callable<Void>() { public Void call() throws Exception { return null; } });
source share