-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.util.concurrent.RejectedExecutionException while executing the transaction #2394
Comments
Hi @shashank090789 You are getting that exception because for some reason there is 100 queued transactions? Are you somehow creating transactions in a loop? |
yes I have 96 rows and and inserting them using transaction |
Instead of doing:
You should do
The later is also more efficient. |
I am using the same, but I am getting each row one by one from API so for each row following code is running
|
@shashank090789 Did you get the data for each row from the API in a background thread? In that case you don't have to use asyc transaction to make it more complex, just use the sync transaction write them one by one. |
Hi @shashank090789 |
Hi @cmelchior |
@shashank090789 In that case, i suggest you to cache the 96 rows and write them in on async transaction. Or maybe there are some difficulties for this approach like the there is no end point of the broadcast? |
@shashank090789 Did you manage to solve this issue? Can we close it? |
I will check it and let you know if further get the same issue |
Thank you. We will wait a bit for your answer before closing this issue. |
@shashank090789 Any updates to share? |
@kneth |
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@3d35e112 rejected from io.realm.internal.async.RealmThreadPoolExecutor@207080e3[Running, pool size = 5, active threads = 5, queued tasks = 100, completed tasks = 3637]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2011)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:793)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1339)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:81)
at io.realm.internal.async.RealmThreadPoolExecutor.submit(RealmThreadPoolExecutor.java:63)
at io.realm.Realm.executeTransaction(Realm.java:1091)
The text was updated successfully, but these errors were encountered: